Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2841446

Browse files
committed
test: ensure no deprecation when Factories used in parent class
1 parent 1e94ca1 commit 2841446

3 files changed

Lines changed: 75 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the zenstruck/foundry package.
7+
*
8+
* (c) Kevin Bond <[email protected]>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
14+
namespace Zenstruck\Foundry\Tests\Integration\ForceFactoriesTraitUsage;
15+
16+
use PHPUnit\Framework\Attributes\RequiresPhpunitExtension;
17+
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
18+
use Zenstruck\Foundry\Test\Factories;
19+
use Zenstruck\Foundry\Test\ResetDatabase;
20+
21+
abstract class AnotherTestCase extends KernelTestCase
22+
{
23+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the zenstruck/foundry package.
7+
*
8+
* (c) Kevin Bond <[email protected]>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
14+
namespace Zenstruck\Foundry\Tests\Integration\ForceFactoriesTraitUsage;
15+
16+
use PHPUnit\Framework\Attributes\RequiresPhpunit;
17+
use PHPUnit\Framework\Attributes\Test;
18+
use Zenstruck\Foundry\Tests\Fixture\Factories\Object1Factory;
19+
20+
#[RequiresPhpunit('>=11.0')]
21+
final class ClassExtendingBaseTestCaseUsingFactoriesTest extends KernelTestCaseWithFactoriesTraitTestCase
22+
{
23+
#[Test]
24+
public function not_using_foundry_should_not_throw(): void
25+
{
26+
$this->expectNotToPerformAssertions();
27+
28+
Object1Factory::createOne();
29+
}
30+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the zenstruck/foundry package.
7+
*
8+
* (c) Kevin Bond <[email protected]>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
14+
namespace Zenstruck\Foundry\Tests\Integration\ForceFactoriesTraitUsage;
15+
16+
use Zenstruck\Foundry\Test\Factories;
17+
use Zenstruck\Foundry\Test\ResetDatabase;
18+
19+
abstract class KernelTestCaseWithFactoriesTraitTestCase extends AnotherTestCase
20+
{
21+
use Factories, ResetDatabase;
22+
}

0 commit comments

Comments
 (0)