Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Imports #657

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions example/test/AutoReview/FixtureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
namespace Example\Test\AutoReview;

use Ergebnis\FactoryBot;
use Example\Test\Unit;
use Example\Test;

/**
* @internal
* @coversNothing
*/
final class FixtureTest extends Unit\AbstractTestCase
final class FixtureTest extends Test\Unit\AbstractTestCase
{
public function testEntitiesHaveEntityDefinitionProviders(): void
{
Expand Down
4 changes: 2 additions & 2 deletions example/test/Unit/Entity/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
namespace Example\Test\Unit\Entity;

use Example\Entity;
use Example\Test\Unit;
use Example\Test;

/**
* @internal
*
* @covers \Example\Entity\User
*/
final class UserTest extends Unit\AbstractTestCase
final class UserTest extends Test\Unit\AbstractTestCase
{
public function testRenameToRenamesUser(): void
{
Expand Down
2 changes: 1 addition & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.9.3@4c262932602b9bbab5020863d1eb22d49de0dbf4">
<files psalm-version="4.11.2@6fba5eb554f9507b72932f9c75533d8af593688d">
<file src="example/test/AutoReview/FixtureTest.php">
<ArgumentTypeCoercion occurrences="1">
<code>$providerClassName</code>
Expand Down
4 changes: 2 additions & 2 deletions test/AutoReview/SrcCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Ergebnis\FactoryBot\Test\AutoReview;

use Ergebnis\FactoryBot;
use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
Expand All @@ -24,7 +24,7 @@
*/
final class SrcCodeTest extends Framework\TestCase
{
use Helper;
use Util\Helper;

public function testSrcClassesHaveUnitTests(): void
{
Expand Down
4 changes: 2 additions & 2 deletions test/DataProvider/IntProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace Ergebnis\FactoryBot\Test\DataProvider;

use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;

final class IntProvider
{
use Helper;
use Util\Helper;

/**
* @return \Generator<string, array<int>>
Expand Down
4 changes: 2 additions & 2 deletions test/DataProvider/ValueProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

namespace Ergebnis\FactoryBot\Test\DataProvider;

use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;

final class ValueProvider
{
use Helper;
use Util\Helper;

/**
* @return \Generator<string, array<string[], bool, float, int, object, \stdClass, string>>
Expand Down
8 changes: 4 additions & 4 deletions test/Integration/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
namespace Ergebnis\FactoryBot\Test\Integration;

use Doctrine\ORM;
use Ergebnis\FactoryBot\Test\Util;
use Ergebnis\Test\Util\Helper;
use Ergebnis\FactoryBot\Test;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
* @internal
*/
abstract class AbstractTestCase extends Framework\TestCase
{
use Helper;
use Util\Helper;

final protected static function entityManager(): ORM\EntityManagerInterface
{
$entityManager = Util\Doctrine\ORM\EntityManagerFactory::create();
$entityManager = Test\Util\Doctrine\ORM\EntityManagerFactory::create();

$schemaTool = new ORM\Tools\SchemaTool($entityManager);

Expand Down
8 changes: 4 additions & 4 deletions test/Unit/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
namespace Ergebnis\FactoryBot\Test\Unit;

use Doctrine\ORM;
use Ergebnis\FactoryBot\Test\Util;
use Ergebnis\Test\Util\Helper;
use Ergebnis\FactoryBot\Test;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
* @internal
*/
abstract class AbstractTestCase extends Framework\TestCase
{
use Helper;
use Util\Helper;

final protected static function entityManager(): ORM\EntityManagerInterface
{
return Util\Doctrine\ORM\EntityManagerFactory::create();
return Test\Util\Doctrine\ORM\EntityManagerFactory::create();
}
}
4 changes: 2 additions & 2 deletions test/Unit/CountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use Ergebnis\FactoryBot\Count;
use Ergebnis\FactoryBot\Exception;
use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
Expand All @@ -29,7 +29,7 @@
*/
final class CountTest extends Framework\TestCase
{
use Helper;
use Util\Helper;

/**
* @dataProvider \Ergebnis\FactoryBot\Test\DataProvider\IntProvider::lessThanZero()
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/EntityDefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Ergebnis\FactoryBot\EntityDefinition;
use Ergebnis\FactoryBot\Exception;
use Ergebnis\FactoryBot\FieldDefinition;
use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
Expand All @@ -31,7 +31,7 @@
*/
final class EntityDefinitionTest extends Framework\TestCase
{
use Helper;
use Util\Helper;

/**
* @dataProvider \Ergebnis\FactoryBot\Test\DataProvider\ValueProvider::arbitrary()
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Exception/InvalidCountTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Ergebnis\FactoryBot\Test\Unit\Exception;

use Ergebnis\FactoryBot\Exception;
use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
Expand All @@ -24,7 +24,7 @@
*/
final class InvalidCountTest extends Framework\TestCase
{
use Helper;
use Util\Helper;

public function testNotGreaterThanOrEqualToReturnsException(): void
{
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Exception/InvalidDefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Ergebnis\FactoryBot\Test\Unit\Exception;

use Ergebnis\FactoryBot\Exception;
use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
Expand All @@ -24,7 +24,7 @@
*/
final class InvalidDefinitionTest extends Framework\TestCase
{
use Helper;
use Util\Helper;

public function testCanNotBeAutoloadedReturnsException(): void
{
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Exception/InvalidDirectoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Ergebnis\FactoryBot\Test\Unit\Exception;

use Ergebnis\FactoryBot\Exception;
use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
Expand All @@ -24,7 +24,7 @@
*/
final class InvalidDirectoryTest extends Framework\TestCase
{
use Helper;
use Util\Helper;

public function testNotDirectoryCreatesException(): void
{
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Exception/InvalidFieldDefinitionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

use Ergebnis\FactoryBot\Exception;
use Ergebnis\FactoryBot\FieldDefinition;
use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
Expand All @@ -25,7 +25,7 @@
*/
final class InvalidFieldDefinitionsTest extends Framework\TestCase
{
use Helper;
use Util\Helper;

public function testFromClassNameCreatesException(): void
{
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Exception/InvalidFieldNamesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Ergebnis\FactoryBot\Test\Unit\Exception;

use Ergebnis\FactoryBot\Exception;
use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
Expand All @@ -24,7 +24,7 @@
*/
final class InvalidFieldNamesTest extends Framework\TestCase
{
use Helper;
use Util\Helper;

public function testNotFoundInReturnsExceptionWhenOnlyOneFieldNameIsProvided(): void
{
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Exception/InvalidMaximumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Ergebnis\FactoryBot\Test\Unit\Exception;

use Ergebnis\FactoryBot\Exception;
use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
Expand All @@ -24,7 +24,7 @@
*/
final class InvalidMaximumTest extends Framework\TestCase
{
use Helper;
use Util\Helper;

public function testNotGreaterThanMinimumReturnsException(): void
{
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Exception/InvalidMinimumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Ergebnis\FactoryBot\Test\Unit\Exception;

use Ergebnis\FactoryBot\Exception;
use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
Expand All @@ -24,7 +24,7 @@
*/
final class InvalidMinimumTest extends Framework\TestCase
{
use Helper;
use Util\Helper;

public function testNotGreaterThanOrEqualToReturnsException(): void
{
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Exception/InvalidSequenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
namespace Ergebnis\FactoryBot\Test\Unit\Exception;

use Ergebnis\FactoryBot\Exception;
use Ergebnis\Test\Util\Helper;
use Ergebnis\Test\Util;
use PHPUnit\Framework;

/**
Expand All @@ -24,7 +24,7 @@
*/
final class InvalidSequenceTest extends Framework\TestCase
{
use Helper;
use Util\Helper;

public function testValueReturnsException(): void
{
Expand Down
11 changes: 5 additions & 6 deletions test/Unit/FieldDefinition/OptionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@

namespace Ergebnis\FactoryBot\Test\Unit\FieldDefinition;

use Ergebnis\FactoryBot\FieldDefinition\Optional;
use Ergebnis\FactoryBot\FieldDefinition\Resolvable;
use Ergebnis\FactoryBot\FieldDefinition;
use Ergebnis\FactoryBot\FixtureFactory;
use Ergebnis\FactoryBot\Test\Unit;
use Ergebnis\FactoryBot\Test;
use Example\Entity;
use Faker\Generator;

Expand All @@ -31,7 +30,7 @@
* @uses \Ergebnis\FactoryBot\FixtureFactory
* @uses \Ergebnis\FactoryBot\Strategy\DefaultStrategy
*/
final class OptionalTest extends Unit\AbstractTestCase
final class OptionalTest extends Test\Unit\AbstractTestCase
{
public function testResolvesToResultOfResolvingResolvableWithFixtureFactory(): void
{
Expand All @@ -44,14 +43,14 @@ public function testResolvesToResultOfResolvingResolvableWithFixtureFactory(): v

$fixtureFactory->define(Entity\User::class);

$resolvable = new class() implements Resolvable {
$resolvable = new class() implements FieldDefinition\Resolvable {
public function resolve(Generator $faker, FixtureFactory $fixtureFactory)
{
return $fixtureFactory->createOne(Entity\User::class);
}
};

$fieldDefinition = new Optional($resolvable);
$fieldDefinition = new FieldDefinition\Optional($resolvable);

$resolved = $fieldDefinition->resolve(
$faker,
Expand Down
8 changes: 4 additions & 4 deletions test/Unit/FieldDefinition/ReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Ergebnis\FactoryBot\Test\Unit\FieldDefinition;

use Ergebnis\FactoryBot\FieldDefinition\Reference;
use Ergebnis\FactoryBot\FieldDefinition;
use Ergebnis\FactoryBot\FixtureFactory;
use Ergebnis\FactoryBot\Test\Unit;
use Ergebnis\FactoryBot\Test;
use Example\Entity;

/**
Expand All @@ -29,7 +29,7 @@
* @uses \Ergebnis\FactoryBot\FixtureFactory
* @uses \Ergebnis\FactoryBot\Strategy\DefaultStrategy
*/
final class ReferenceTest extends Unit\AbstractTestCase
final class ReferenceTest extends Test\Unit\AbstractTestCase
{
public function testResolvesToObjectCreatedByFixtureFactory(): void
{
Expand All @@ -44,7 +44,7 @@ public function testResolvesToObjectCreatedByFixtureFactory(): void

$fixtureFactory->define($className);

$fieldDefinition = new Reference($className);
$fieldDefinition = new FieldDefinition\Reference($className);

$resolved = $fieldDefinition->resolve(
$faker,
Expand Down
Loading