Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Benchmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function toConsole(): static
return $this;
}

public function assert(): AssertService
public function toAssert(): AssertService
{
return new AssertService(
$this->toData()
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Assertions/ToBeAvgMemoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@

test('success', function () {
benchmark()
->assert()
->toAssert()
->toBeAvgMemory(1, 10000);

expect(true)->toBeTrue();
});

test('success without arguments', function () {
benchmark()
->assert()
->toAssert()
->toBeAvgMemory();

expect(true)->toBeTrue();
});

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.');
8 changes: 4 additions & 4 deletions tests/Unit/Assertions/ToBeAvgTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@

test('success', function () {
benchmark()
->assert()
->toAssert()
->toBeAvgTime(1, 1000);

expect(true)->toBeTrue();
});

test('success without arguments', function () {
benchmark()
->assert()
->toAssert()
->toBeAvgTime();

expect(true)->toBeTrue();
});

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.');
8 changes: 4 additions & 4 deletions tests/Unit/Assertions/ToBeMaxMemoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@

test('success', function () {
benchmark()
->assert()
->toAssert()
->toBeMaxMemory(1, 10000);

expect(true)->toBeTrue();
});

test('success without arguments', function () {
benchmark()
->assert()
->toAssert()
->toBeMaxMemory();

expect(true)->toBeTrue();
});

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.');
8 changes: 4 additions & 4 deletions tests/Unit/Assertions/ToBeMaxTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@

test('success', function () {
benchmark()
->assert()
->toAssert()
->toBeMaxTime(1, 1000);

expect(true)->toBeTrue();
});

test('success without arguments', function () {
benchmark()
->assert()
->toAssert()
->toBeMaxTime();

expect(true)->toBeTrue();
});

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.');
8 changes: 4 additions & 4 deletions tests/Unit/Assertions/ToBeMinMemoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@

test('success', function () {
benchmark()
->assert()
->toAssert()
->toBeMinMemory(1, 10000);

expect(true)->toBeTrue();
});

test('success without arguments', function () {
benchmark()
->assert()
->toAssert()
->toBeMinMemory();

expect(true)->toBeTrue();
});

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.');
8 changes: 4 additions & 4 deletions tests/Unit/Assertions/ToBeMinTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@

test('success', function () {
benchmark()
->assert()
->toAssert()
->toBeMinTime(1, 1000);

expect(true)->toBeTrue();
});

test('success without arguments', function () {
benchmark()
->assert()
->toAssert()
->toBeMinTime();

expect(true)->toBeTrue();
});

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.');
8 changes: 4 additions & 4 deletions tests/Unit/Assertions/ToBeTotalMemoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@

test('success', function () {
benchmark()
->assert()
->toAssert()
->toBeTotalMemory(1, 10000);

expect(true)->toBeTrue();
});

test('success without arguments', function () {
benchmark()
->assert()
->toAssert()
->toBeTotalMemory();

expect(true)->toBeTrue();
});

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.');
8 changes: 4 additions & 4 deletions tests/Unit/Assertions/ToBeTotalTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@

test('success', function () {
benchmark()
->assert()
->toAssert()
->toBeTotalTime(1, 1000);

expect(true)->toBeTrue();
});

test('success without arguments', function () {
benchmark()
->assert()
->toAssert()
->toBeTotalTime();

expect(true)->toBeTrue();
});

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.');