mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
14 lines
578 B
PHP
14 lines
578 B
PHP
<?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));
|
|
});
|