mirror of
https://github.com/pestphp/pest.git
synced 2026-03-10 17:57:23 +01:00
feat(expect): updates test suite to use expectation api
This commit is contained in:
@ -7,14 +7,14 @@ use PHPUnit\TextUI\DefaultResultPrinter;
|
||||
it('sets defaults', function () {
|
||||
$arguments = AddsDefaults::to(['bar' => 'foo']);
|
||||
|
||||
assertInstanceOf(Printer::class, $arguments['printer']);
|
||||
assertEquals($arguments['bar'], 'foo');
|
||||
expect($arguments['printer'])->toBeInstanceOf(Printer::class);
|
||||
expect($arguments['bar'])->toBe('foo');
|
||||
});
|
||||
|
||||
it('does not override options', function () {
|
||||
$defaultResultPrinter = new DefaultResultPrinter();
|
||||
|
||||
assertEquals(AddsDefaults::to(['printer' => $defaultResultPrinter]), [
|
||||
expect(AddsDefaults::to(['printer' => $defaultResultPrinter]))->tobe([
|
||||
'printer' => $defaultResultPrinter,
|
||||
]);
|
||||
});
|
||||
|
||||
@ -16,10 +16,10 @@ test('default php unit tests', function () {
|
||||
$phpUnitTestCase = new class() extends PhpUnitTestCase {
|
||||
};
|
||||
$testSuite->addTest($phpUnitTestCase);
|
||||
assertCount(1, $testSuite->tests());
|
||||
expect($testSuite->tests())->toHaveCount(1);
|
||||
|
||||
AddsTests::to($testSuite, new \Pest\TestSuite(getcwd()));
|
||||
assertCount(1, $testSuite->tests());
|
||||
expect($testSuite->tests())->toHaveCount(1);
|
||||
});
|
||||
|
||||
it('removes warnings', function () use ($pestTestCase) {
|
||||
@ -28,5 +28,5 @@ it('removes warnings', function () use ($pestTestCase) {
|
||||
$testSuite->addTest($warningTestCase);
|
||||
|
||||
AddsTests::to($testSuite, new \Pest\TestSuite(getcwd()));
|
||||
assertCount(0, $testSuite->tests());
|
||||
expect($testSuite->tests())->toHaveCount(0);
|
||||
});
|
||||
|
||||
@ -38,5 +38,5 @@ it('do not throws exception when `process isolation` is false', function () {
|
||||
'configuration' => $filename,
|
||||
]);
|
||||
|
||||
assertTrue(true);
|
||||
expect(true)->toBeTrue();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user