mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
first
This commit is contained in:
13
tests/Unit/TestSuite.php
Normal file
13
tests/Unit/TestSuite.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
use Pest\Exceptions\TestAlreadyExist;
|
||||
use Pest\TestSuite;
|
||||
|
||||
it('does not allow to add the same test description twice', function () {
|
||||
$testSuite = new TestSuite(getcwd());
|
||||
$test = function () {};
|
||||
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test));
|
||||
$this->expectException(TestAlreadyExist::class);
|
||||
$this->expectExceptionMessage(sprintf('A test with the description `%s` already exist in the filename `%s`.', 'foo', __FILE__));
|
||||
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test));
|
||||
});
|
||||
Reference in New Issue
Block a user