-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathToBeTotalMemoryTest.php
More file actions
31 lines (24 loc) · 754 Bytes
/
ToBeTotalMemoryTest.php
File metadata and controls
31 lines (24 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
declare(strict_types=1);
test('success', function () {
benchmark()
->toAssert()
->toBeTotalMemory(1, 10000);
expect(true)->toBeTrue();
});
test('success without arguments', function () {
benchmark()
->toAssert()
->toBeTotalMemory();
expect(true)->toBeTrue();
});
test('failure greater than', function () {
benchmark()
->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()
->toAssert()
->toBeTotalMemory(till: 10);
})->throws(AssertionError::class, 'The total memory value must be less than or equal to 10.');