Answer the question
In order to leave comments, you need to log in
Dependency of tests on tests from other cases in another namespace?
<testsuites>
<testsuite name="Functional Test Suite">
<directory>tests/Functional/UrlAvailability</directory> // check if all url available
<directory>tests/Functional</directory> // after run other test which depends on test from above folder
</testsuite>
</testsuites>
namespace App\Tests\Functional\UrlAvailability;
final class PublicUrlAvailabilityTest extends FunctionalTestCase
{
/**
* Urls only for NOT logged users
*
* @test
*
* @dataProvider onlyForNotAuthenticatedUrls
*
* @param string $url
*/
public function pagesAvailableForNotAuthenticatedUser(string $url): void
{
$client = self::createClient();
$client->request(Request::METHOD_GET, $url);
static::assertTrue($client->getResponse()->isSuccessful(), \sprintf('In %s for %s', __FUNCTION__, $url));
}
/**
*
* @return array
*/
public function onlyForNotAuthenticatedUrls(): array
{
return [
['/login/'],
['/forgot-pass/'],
['/reset-pass/'],
];
}
class LoginControllerTest extends FunctionalTestCase
{
/**
* Test if an inactive user can login.
*
* @depends \App\Tests\Functional\PublicUrlAvailabilityTest::pagesAvailableForNotAuthenticatedUser
*
* @test
*/
public function inactiveUserCanLogin(): void
{
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question