diff --git a/src/Benchmark.php b/src/Benchmark.php index 0b18ba2..44e6ee0 100644 --- a/src/Benchmark.php +++ b/src/Benchmark.php @@ -117,7 +117,7 @@ public function toConsole(): static return $this; } - public function assert(): AssertService + public function toAssert(): AssertService { return new AssertService( $this->toData() diff --git a/tests/Unit/Assertions/ToBeAvgMemoryTest.php b/tests/Unit/Assertions/ToBeAvgMemoryTest.php index be49257..858aaee 100644 --- a/tests/Unit/Assertions/ToBeAvgMemoryTest.php +++ b/tests/Unit/Assertions/ToBeAvgMemoryTest.php @@ -4,7 +4,7 @@ test('success', function () { benchmark() - ->assert() + ->toAssert() ->toBeAvgMemory(1, 10000); expect(true)->toBeTrue(); @@ -12,7 +12,7 @@ test('success without arguments', function () { benchmark() - ->assert() + ->toAssert() ->toBeAvgMemory(); expect(true)->toBeTrue(); @@ -20,12 +20,12 @@ test('failure greater than', function () { benchmark() - ->assert() + ->toAssert() ->toBeAvgMemory(from: 10000); })->throws(AssertionError::class, 'The average memory value must be greater than or equal to 10000.'); test('failure less than', function () { benchmark() - ->assert() + ->toAssert() ->toBeAvgMemory(till: 1); })->throws(AssertionError::class, 'The average memory value must be less than or equal to 1.'); diff --git a/tests/Unit/Assertions/ToBeAvgTimeTest.php b/tests/Unit/Assertions/ToBeAvgTimeTest.php index f834497..7ec919a 100644 --- a/tests/Unit/Assertions/ToBeAvgTimeTest.php +++ b/tests/Unit/Assertions/ToBeAvgTimeTest.php @@ -4,7 +4,7 @@ test('success', function () { benchmark() - ->assert() + ->toAssert() ->toBeAvgTime(1, 1000); expect(true)->toBeTrue(); @@ -12,7 +12,7 @@ test('success without arguments', function () { benchmark() - ->assert() + ->toAssert() ->toBeAvgTime(); expect(true)->toBeTrue(); @@ -20,12 +20,12 @@ test('failure greater than', function () { benchmark() - ->assert() + ->toAssert() ->toBeAvgTime(from: 1000); })->throws(AssertionError::class, 'The average time value must be greater than or equal to 1000.'); test('failure less than', function () { benchmark() - ->assert() + ->toAssert() ->toBeAvgTime(till: 1); })->throws(AssertionError::class, 'The average time value must be less than or equal to 1.'); diff --git a/tests/Unit/Assertions/ToBeMaxMemoryTest.php b/tests/Unit/Assertions/ToBeMaxMemoryTest.php index 39a253e..1e5cda9 100644 --- a/tests/Unit/Assertions/ToBeMaxMemoryTest.php +++ b/tests/Unit/Assertions/ToBeMaxMemoryTest.php @@ -4,7 +4,7 @@ test('success', function () { benchmark() - ->assert() + ->toAssert() ->toBeMaxMemory(1, 10000); expect(true)->toBeTrue(); @@ -12,7 +12,7 @@ test('success without arguments', function () { benchmark() - ->assert() + ->toAssert() ->toBeMaxMemory(); expect(true)->toBeTrue(); @@ -20,12 +20,12 @@ test('failure greater than', function () { benchmark() - ->assert() + ->toAssert() ->toBeMaxMemory(from: 10000); })->throws(AssertionError::class, 'The maximum memory value must be greater than or equal to 10000.'); test('failure less than', function () { benchmark() - ->assert() + ->toAssert() ->toBeMaxMemory(till: 1); })->throws(AssertionError::class, 'The maximum memory value must be less than or equal to 1.'); diff --git a/tests/Unit/Assertions/ToBeMaxTimeTest.php b/tests/Unit/Assertions/ToBeMaxTimeTest.php index 16d428b..b6954eb 100644 --- a/tests/Unit/Assertions/ToBeMaxTimeTest.php +++ b/tests/Unit/Assertions/ToBeMaxTimeTest.php @@ -4,7 +4,7 @@ test('success', function () { benchmark() - ->assert() + ->toAssert() ->toBeMaxTime(1, 1000); expect(true)->toBeTrue(); @@ -12,7 +12,7 @@ test('success without arguments', function () { benchmark() - ->assert() + ->toAssert() ->toBeMaxTime(); expect(true)->toBeTrue(); @@ -20,12 +20,12 @@ test('failure greater than', function () { benchmark() - ->assert() + ->toAssert() ->toBeMaxTime(from: 1000); })->throws(AssertionError::class, 'The maximum time value must be greater than or equal to 1000.'); test('failure less than', function () { benchmark() - ->assert() + ->toAssert() ->toBeMaxTime(till: 1); })->throws(AssertionError::class, 'The maximum time value must be less than or equal to 1.'); diff --git a/tests/Unit/Assertions/ToBeMinMemoryTest.php b/tests/Unit/Assertions/ToBeMinMemoryTest.php index 842583e..a47a5e0 100644 --- a/tests/Unit/Assertions/ToBeMinMemoryTest.php +++ b/tests/Unit/Assertions/ToBeMinMemoryTest.php @@ -4,7 +4,7 @@ test('success', function () { benchmark() - ->assert() + ->toAssert() ->toBeMinMemory(1, 10000); expect(true)->toBeTrue(); @@ -12,7 +12,7 @@ test('success without arguments', function () { benchmark() - ->assert() + ->toAssert() ->toBeMinMemory(); expect(true)->toBeTrue(); @@ -20,12 +20,12 @@ test('failure greater than', function () { benchmark() - ->assert() + ->toAssert() ->toBeMinMemory(from: 10000); })->throws(AssertionError::class, 'The minimum memory value must be greater than or equal to 10000.'); test('failure less than', function () { benchmark() - ->assert() + ->toAssert() ->toBeMinMemory(till: 1); })->throws(AssertionError::class, 'The minimum memory value must be less than or equal to 1.'); diff --git a/tests/Unit/Assertions/ToBeMinTimeTest.php b/tests/Unit/Assertions/ToBeMinTimeTest.php index 2342b57..bd6407a 100644 --- a/tests/Unit/Assertions/ToBeMinTimeTest.php +++ b/tests/Unit/Assertions/ToBeMinTimeTest.php @@ -4,7 +4,7 @@ test('success', function () { benchmark() - ->assert() + ->toAssert() ->toBeMinTime(1, 1000); expect(true)->toBeTrue(); @@ -12,7 +12,7 @@ test('success without arguments', function () { benchmark() - ->assert() + ->toAssert() ->toBeMinTime(); expect(true)->toBeTrue(); @@ -20,12 +20,12 @@ test('failure greater than', function () { benchmark() - ->assert() + ->toAssert() ->toBeMinTime(from: 1000); })->throws(AssertionError::class, 'The minimum time value must be greater than or equal to 1000.'); test('failure less than', function () { benchmark() - ->assert() + ->toAssert() ->toBeMinTime(till: 1); })->throws(AssertionError::class, 'The minimum time value must be less than or equal to 1.'); diff --git a/tests/Unit/Assertions/ToBeTotalMemoryTest.php b/tests/Unit/Assertions/ToBeTotalMemoryTest.php index d4e8b53..078c843 100644 --- a/tests/Unit/Assertions/ToBeTotalMemoryTest.php +++ b/tests/Unit/Assertions/ToBeTotalMemoryTest.php @@ -4,7 +4,7 @@ test('success', function () { benchmark() - ->assert() + ->toAssert() ->toBeTotalMemory(1, 10000); expect(true)->toBeTrue(); @@ -12,7 +12,7 @@ test('success without arguments', function () { benchmark() - ->assert() + ->toAssert() ->toBeTotalMemory(); expect(true)->toBeTrue(); @@ -20,12 +20,12 @@ test('failure greater than', function () { benchmark() - ->assert() + ->toAssert() ->toBeTotalMemory(from: 10000); })->throws(AssertionError::class, 'The total memory value must be greater than or equal to 10000.'); test('failure less than', function () { benchmark() - ->assert() + ->toAssert() ->toBeTotalMemory(till: 10); })->throws(AssertionError::class, 'The total memory value must be less than or equal to 10.'); diff --git a/tests/Unit/Assertions/ToBeTotalTimeTest.php b/tests/Unit/Assertions/ToBeTotalTimeTest.php index ad9a5f8..dbc3ee7 100644 --- a/tests/Unit/Assertions/ToBeTotalTimeTest.php +++ b/tests/Unit/Assertions/ToBeTotalTimeTest.php @@ -4,7 +4,7 @@ test('success', function () { benchmark() - ->assert() + ->toAssert() ->toBeTotalTime(1, 1000); expect(true)->toBeTrue(); @@ -12,7 +12,7 @@ test('success without arguments', function () { benchmark() - ->assert() + ->toAssert() ->toBeTotalTime(); expect(true)->toBeTrue(); @@ -20,12 +20,12 @@ test('failure greater than', function () { benchmark() - ->assert() + ->toAssert() ->toBeTotalTime(from: 1000); })->throws(AssertionError::class, 'The total time value must be greater than or equal to 1000.'); test('failure less than', function () { benchmark() - ->assert() + ->toAssert() ->toBeTotalTime(till: 10); })->throws(AssertionError::class, 'The total time value must be less than or equal to 10.');