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)); });