Skip to content

Commit e8da32f

Browse files
Merge pull request #78
[4.x] Rename `assert` method to `toAssert` in `Benchmark` and update all related tests
2 parents 2f30a6a + 9996279 commit e8da32f

9 files changed

Lines changed: 33 additions & 33 deletions

src/Benchmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function toConsole(): static
117117
return $this;
118118
}
119119

120-
public function assert(): AssertService
120+
public function toAssert(): AssertService
121121
{
122122
return new AssertService(
123123
$this->toData()

tests/Unit/Assertions/ToBeAvgMemoryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44

55
test('success', function () {
66
benchmark()
7-
->assert()
7+
->toAssert()
88
->toBeAvgMemory(1, 10000);
99

1010
expect(true)->toBeTrue();
1111
});
1212

1313
test('success without arguments', function () {
1414
benchmark()
15-
->assert()
15+
->toAssert()
1616
->toBeAvgMemory();
1717

1818
expect(true)->toBeTrue();
1919
});
2020

2121
test('failure greater than', function () {
2222
benchmark()
23-
->assert()
23+
->toAssert()
2424
->toBeAvgMemory(from: 10000);
2525
})->throws(AssertionError::class, 'The average memory value must be greater than or equal to 10000.');
2626

2727
test('failure less than', function () {
2828
benchmark()
29-
->assert()
29+
->toAssert()
3030
->toBeAvgMemory(till: 1);
3131
})->throws(AssertionError::class, 'The average memory value must be less than or equal to 1.');

tests/Unit/Assertions/ToBeAvgTimeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44

55
test('success', function () {
66
benchmark()
7-
->assert()
7+
->toAssert()
88
->toBeAvgTime(1, 1000);
99

1010
expect(true)->toBeTrue();
1111
});
1212

1313
test('success without arguments', function () {
1414
benchmark()
15-
->assert()
15+
->toAssert()
1616
->toBeAvgTime();
1717

1818
expect(true)->toBeTrue();
1919
});
2020

2121
test('failure greater than', function () {
2222
benchmark()
23-
->assert()
23+
->toAssert()
2424
->toBeAvgTime(from: 1000);
2525
})->throws(AssertionError::class, 'The average time value must be greater than or equal to 1000.');
2626

2727
test('failure less than', function () {
2828
benchmark()
29-
->assert()
29+
->toAssert()
3030
->toBeAvgTime(till: 1);
3131
})->throws(AssertionError::class, 'The average time value must be less than or equal to 1.');

tests/Unit/Assertions/ToBeMaxMemoryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44

55
test('success', function () {
66
benchmark()
7-
->assert()
7+
->toAssert()
88
->toBeMaxMemory(1, 10000);
99

1010
expect(true)->toBeTrue();
1111
});
1212

1313
test('success without arguments', function () {
1414
benchmark()
15-
->assert()
15+
->toAssert()
1616
->toBeMaxMemory();
1717

1818
expect(true)->toBeTrue();
1919
});
2020

2121
test('failure greater than', function () {
2222
benchmark()
23-
->assert()
23+
->toAssert()
2424
->toBeMaxMemory(from: 10000);
2525
})->throws(AssertionError::class, 'The maximum memory value must be greater than or equal to 10000.');
2626

2727
test('failure less than', function () {
2828
benchmark()
29-
->assert()
29+
->toAssert()
3030
->toBeMaxMemory(till: 1);
3131
})->throws(AssertionError::class, 'The maximum memory value must be less than or equal to 1.');

tests/Unit/Assertions/ToBeMaxTimeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44

55
test('success', function () {
66
benchmark()
7-
->assert()
7+
->toAssert()
88
->toBeMaxTime(1, 1000);
99

1010
expect(true)->toBeTrue();
1111
});
1212

1313
test('success without arguments', function () {
1414
benchmark()
15-
->assert()
15+
->toAssert()
1616
->toBeMaxTime();
1717

1818
expect(true)->toBeTrue();
1919
});
2020

2121
test('failure greater than', function () {
2222
benchmark()
23-
->assert()
23+
->toAssert()
2424
->toBeMaxTime(from: 1000);
2525
})->throws(AssertionError::class, 'The maximum time value must be greater than or equal to 1000.');
2626

2727
test('failure less than', function () {
2828
benchmark()
29-
->assert()
29+
->toAssert()
3030
->toBeMaxTime(till: 1);
3131
})->throws(AssertionError::class, 'The maximum time value must be less than or equal to 1.');

tests/Unit/Assertions/ToBeMinMemoryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44

55
test('success', function () {
66
benchmark()
7-
->assert()
7+
->toAssert()
88
->toBeMinMemory(1, 10000);
99

1010
expect(true)->toBeTrue();
1111
});
1212

1313
test('success without arguments', function () {
1414
benchmark()
15-
->assert()
15+
->toAssert()
1616
->toBeMinMemory();
1717

1818
expect(true)->toBeTrue();
1919
});
2020

2121
test('failure greater than', function () {
2222
benchmark()
23-
->assert()
23+
->toAssert()
2424
->toBeMinMemory(from: 10000);
2525
})->throws(AssertionError::class, 'The minimum memory value must be greater than or equal to 10000.');
2626

2727
test('failure less than', function () {
2828
benchmark()
29-
->assert()
29+
->toAssert()
3030
->toBeMinMemory(till: 1);
3131
})->throws(AssertionError::class, 'The minimum memory value must be less than or equal to 1.');

tests/Unit/Assertions/ToBeMinTimeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44

55
test('success', function () {
66
benchmark()
7-
->assert()
7+
->toAssert()
88
->toBeMinTime(1, 1000);
99

1010
expect(true)->toBeTrue();
1111
});
1212

1313
test('success without arguments', function () {
1414
benchmark()
15-
->assert()
15+
->toAssert()
1616
->toBeMinTime();
1717

1818
expect(true)->toBeTrue();
1919
});
2020

2121
test('failure greater than', function () {
2222
benchmark()
23-
->assert()
23+
->toAssert()
2424
->toBeMinTime(from: 1000);
2525
})->throws(AssertionError::class, 'The minimum time value must be greater than or equal to 1000.');
2626

2727
test('failure less than', function () {
2828
benchmark()
29-
->assert()
29+
->toAssert()
3030
->toBeMinTime(till: 1);
3131
})->throws(AssertionError::class, 'The minimum time value must be less than or equal to 1.');

tests/Unit/Assertions/ToBeTotalMemoryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44

55
test('success', function () {
66
benchmark()
7-
->assert()
7+
->toAssert()
88
->toBeTotalMemory(1, 10000);
99

1010
expect(true)->toBeTrue();
1111
});
1212

1313
test('success without arguments', function () {
1414
benchmark()
15-
->assert()
15+
->toAssert()
1616
->toBeTotalMemory();
1717

1818
expect(true)->toBeTrue();
1919
});
2020

2121
test('failure greater than', function () {
2222
benchmark()
23-
->assert()
23+
->toAssert()
2424
->toBeTotalMemory(from: 10000);
2525
})->throws(AssertionError::class, 'The total memory value must be greater than or equal to 10000.');
2626

2727
test('failure less than', function () {
2828
benchmark()
29-
->assert()
29+
->toAssert()
3030
->toBeTotalMemory(till: 10);
3131
})->throws(AssertionError::class, 'The total memory value must be less than or equal to 10.');

tests/Unit/Assertions/ToBeTotalTimeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44

55
test('success', function () {
66
benchmark()
7-
->assert()
7+
->toAssert()
88
->toBeTotalTime(1, 1000);
99

1010
expect(true)->toBeTrue();
1111
});
1212

1313
test('success without arguments', function () {
1414
benchmark()
15-
->assert()
15+
->toAssert()
1616
->toBeTotalTime();
1717

1818
expect(true)->toBeTrue();
1919
});
2020

2121
test('failure greater than', function () {
2222
benchmark()
23-
->assert()
23+
->toAssert()
2424
->toBeTotalTime(from: 1000);
2525
})->throws(AssertionError::class, 'The total time value must be greater than or equal to 1000.');
2626

2727
test('failure less than', function () {
2828
benchmark()
29-
->assert()
29+
->toAssert()
3030
->toBeTotalTime(till: 10);
3131
})->throws(AssertionError::class, 'The total time value must be less than or equal to 10.');

0 commit comments

Comments
 (0)