diff --git a/.env b/.env new file mode 100644 index 0000000..afd9352 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +APP_ENV=test diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index b554687..fd31b79 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -2,7 +2,7 @@ $finder = PhpCsFixer\Finder::create() ->in(__DIR__ . '/packages') - ->in(__DIR__ . '/tests') + ->in(__DIR__ . '/tests/src') ; @@ -10,7 +10,9 @@ return $config->setRules([ '@PER-CS2.0' => true, '@PER-CS2.0:risky' => true, - 'fully_qualified_strict_types' => true, + 'fully_qualified_strict_types' => [ + 'import_symbols' => true, + ], 'global_namespace_import' => [ 'import_classes' => false, 'import_constants' => false, diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e562dd..512c2fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 1.11.0 + +* test: modernization + ## 1.10.2 * chore: cleanup `composer.json` diff --git a/Makefile b/Makefile index d7af4c3..4302d91 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ psalm: .PHONY: phpunit phpunit: $(eval c ?=) + rm -rf tests/var vendor/bin/phpunit $(c) .PHONY: composer-dump diff --git a/composer.json b/composer.json index a2b693d..6b5f4a6 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "psr/http-factory-implementation": "^1.0", "psr/http-message": "^1.0 || ^2.0", "rekalogika/direct-property-access": "^1.1.2 || ^1.2", - "rekalogika/doctrine-collections-decorator": "^2.0", + "rekalogika/doctrine-collections-decorator": "^2.3", "rekalogika/reconstitutor": "^1.3.2 || ^1.4", "rekalogika/temporary-url-bundle": "^1.3", "symfony/config": "^6.2 || ^7.0", @@ -53,7 +53,7 @@ "ekino/phpstan-banned-code": "^2.1", "league/flysystem-memory": "^3.16", "mockery/mockery": "^1.6", - "phpstan/phpstan": "1.12.2 || ^1.12.4 || ^1.13", + "phpstan/phpstan": "^1.12.5 || ^1.13", "phpstan/phpstan-deprecation-rules": "^1.1", "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-phpunit": "^1.3", @@ -63,11 +63,14 @@ "rector/rector": "^1.2", "symfony/asset-mapper": "^6.2 || ^7.0", "symfony/console": "^6.2 || ^7.0", + "symfony/debug-bundle": "^6.2 || ^7.0", + "symfony/dotenv": "^6.2 || ^7.0", "symfony/framework-bundle": "^6.2 || ^7.0", "symfony/http-client": "^6.2 || ^7.0", "symfony/phpunit-bridge": "^6.3 || ^7.0", "symfony/property-info": "^6.2 || ^7.0", "symfony/routing": "^6.2 || ^7.0", + "symfony/runtime": "^6.2 || ^7.0", "symfony/yaml": "^6.2 || ^7.0", "symplify/monorepo-builder": "^11.2.20 || ^11.3", "vimeo/psalm": "^5.26" @@ -115,12 +118,13 @@ }, "autoload-dev": { "psr-4": { - "Rekalogika\\File\\Tests\\": "tests/" + "Rekalogika\\File\\Tests\\": "tests/src/" } }, "config": { "allow-plugins": { - "php-http/discovery": true + "php-http/discovery": true, + "symfony/runtime": true } } } diff --git a/packages/file-bundle/config/tests.php b/packages/file-bundle/config/tests.php index 1ca12fc..675d489 100644 --- a/packages/file-bundle/config/tests.php +++ b/packages/file-bundle/config/tests.php @@ -27,9 +27,9 @@ // add test aliases $serviceIds = TestKernel::getServiceIds(); - foreach ($serviceIds as $serviceId) { - $services->alias('test.' . $serviceId, $serviceId)->public(); - } + // foreach ($serviceIds as $serviceId) { + // $services->set($serviceId)->public(); + // } // filesystem for testing $services->set('test.filesystem', FilesystemOperator::class) diff --git a/packages/file-symfony-bridge/src/HttpFoundation/ToHttpFoundationFileAdapter.php b/packages/file-symfony-bridge/src/HttpFoundation/ToHttpFoundationFileAdapter.php index 96a89b8..f870e06 100644 --- a/packages/file-symfony-bridge/src/HttpFoundation/ToHttpFoundationFileAdapter.php +++ b/packages/file-symfony-bridge/src/HttpFoundation/ToHttpFoundationFileAdapter.php @@ -188,6 +188,7 @@ public function getPath(): string #[\Override] public function getPathInfo($class = null): ?\SplFileInfo { + // @phpstan-ignore return.type return $this->getHttpFoundationFile()->getPathInfo($class); } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 34675c6..91eeea5 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -2,7 +2,7 @@ parameters: level: max paths: - packages - - tests + - tests/src # exceptions: # check: # missingCheckedExceptionInThrows: true diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 25f2468..1dba7de 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,11 +9,19 @@ failOnWarning="false" cacheDirectory=".phpunit.cache" beStrictAboutCoverageMetadata="true"> + + + + + - tests + tests/src/ + packages diff --git a/psalm.xml b/psalm.xml index f3bfb4d..d68c956 100644 --- a/psalm.xml +++ b/psalm.xml @@ -10,7 +10,7 @@ - + @@ -21,8 +21,8 @@ - - + + @@ -34,8 +34,8 @@ - - + + diff --git a/tests/FileBundle/IntegrationTest.php b/tests/FileBundle/IntegrationTest.php deleted file mode 100644 index cf832ad..0000000 --- a/tests/FileBundle/IntegrationTest.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -namespace Rekalogika\File\Tests\FileBundle; - -use PHPUnit\Framework\TestCase; -use Psr\Container\ContainerInterface; -use Rekalogika\File\Tests\TestKernel; - -class IntegrationTest extends TestCase -{ - private ?ContainerInterface $container = null; - - #[\Override] - protected function setUp(): void - { - $kernel = new TestKernel(); - $kernel->boot(); - - $this->container = $kernel->getContainer(); - } - - public function testWiring(): void - { - foreach (TestKernel::getServiceIds() as $serviceId) { - $this->assertInstanceOf( - $serviceId, - $this->container?->get('test.' . $serviceId), - ); - } - } - -} diff --git a/tests/FileServer/TemporaryUrlTest.php b/tests/FileServer/TemporaryUrlTest.php deleted file mode 100644 index 29fc4a4..0000000 --- a/tests/FileServer/TemporaryUrlTest.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE file - * that was distributed with this source code. - */ - -namespace Rekalogika\File\Tests\FileServer; - -use PHPUnit\Framework\TestCase; -use Psr\Container\ContainerInterface; -use Rekalogika\File\File; -use Rekalogika\File\FilePointer; -use Rekalogika\File\Tests\TestKernel; -use Rekalogika\TemporaryUrl\TemporaryUrlGeneratorInterface; - -class TemporaryUrlTest extends TestCase -{ - private ?ContainerInterface $container = null; - - #[\Override] - protected function setUp(): void - { - $kernel = new TestKernel(); - $kernel->boot(); - - $this->container = $kernel->getContainer(); - } - - public function testTemporaryUrlWithFilePointer(): void - { - $temporaryUrlGenerator = $this->container - ?->get('test.' . TemporaryUrlGeneratorInterface::class); - - $this->assertInstanceOf( - TemporaryUrlGeneratorInterface::class, - $temporaryUrlGenerator, - ); - - $filePointer = new FilePointer('default', 'test.txt'); - $url = $temporaryUrlGenerator->generateUrl($filePointer); - - $this->assertStringContainsString('__route__', $url); - } - - public function testTemporaryUrlWithFile(): void - { - $temporaryUrlGenerator = $this->container - ?->get('test.' . TemporaryUrlGeneratorInterface::class); - - $this->assertInstanceOf( - TemporaryUrlGeneratorInterface::class, - $temporaryUrlGenerator, - ); - - $file = new File(__DIR__ . '/../Resources/localFile.txt'); - - $url = $temporaryUrlGenerator->generateUrl($file); - - $this->assertStringContainsString('__route__', $url); - } -} diff --git a/tests/bin/console b/tests/bin/console new file mode 100755 index 0000000..c4e50d9 --- /dev/null +++ b/tests/bin/console @@ -0,0 +1,29 @@ +#!/usr/bin/env php + + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +namespace Rekalogika\Mapper\Tests; + +use Rekalogika\File\Tests\TestKernel; +use Symfony\Bundle\FrameworkBundle\Console\Application; + +require_once dirname(__DIR__).'/../vendor/autoload_runtime.php'; + +return function (array $context) { + $env = $context['APP_ENV'] ?? 'test'; + assert(is_string($env)); + + $kernel = new TestKernel($env, (bool) $context['APP_DEBUG']); + + return new Application($kernel); +}; diff --git a/tests/config/packages/debug.yaml b/tests/config/packages/debug.yaml new file mode 100644 index 0000000..26d4e53 --- /dev/null +++ b/tests/config/packages/debug.yaml @@ -0,0 +1,4 @@ +debug: + # Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser. + # See the "server:dump" command to start a new server. + dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%" diff --git a/tests/config/packages/doctrine.yaml b/tests/config/packages/doctrine.yaml new file mode 100644 index 0000000..96549d4 --- /dev/null +++ b/tests/config/packages/doctrine.yaml @@ -0,0 +1,20 @@ +doctrine: + dbal: + driver: pdo_sqlite + memory: true + charset: UTF8 + + orm: + auto_generate_proxy_classes: true + naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware + controller_resolver: + auto_mapping: false + enable_lazy_ghost_objects: true + report_fields_where_declared: true + mappings: + App: + is_bundle: false + type: attribute + dir: "%kernel.project_dir%/src/Entity" + prefix: 'Rekalogika\File\Tests\Entity' + alias: App diff --git a/tests/config/packages/framework.yaml b/tests/config/packages/framework.yaml new file mode 100644 index 0000000..970e4da --- /dev/null +++ b/tests/config/packages/framework.yaml @@ -0,0 +1,16 @@ +parameters: + kernel.secret: test + +framework: + test: true + http_method_override: false + handle_all_throwables: true + php_errors: + log: true + validation: + email_validation_mode: html5 + http_client: + enabled: true + max_host_connections: 1 + default_options: + timeout: 10 diff --git a/tests/src/Entity/User.php b/tests/src/Entity/User.php new file mode 100644 index 0000000..4d6dcf4 --- /dev/null +++ b/tests/src/Entity/User.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +namespace Rekalogika\File\Tests\Entity; + +use Doctrine\ORM\Mapping as ORM; + +#[ORM\Entity] +class User +{ + #[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')] + private ?int $id = null; + + #[ORM\Column(type: 'string', length: 255)] + private string $name; + + #[ORM\Column(type: 'string', length: 255)] + private string $email; + + public function __construct(string $name, string $email) + { + $this->name = $name; + $this->email = $email; + } + + public function getId(): ?int + { + return $this->id; + } + + public function getName(): string + { + return $this->name; + } + + public function getEmail(): string + { + return $this->email; + } + +} diff --git a/tests/Factory.php b/tests/src/Factory.php similarity index 100% rename from tests/Factory.php rename to tests/src/Factory.php diff --git a/tests/TestKernel.php b/tests/src/TestKernel.php similarity index 75% rename from tests/TestKernel.php rename to tests/src/TestKernel.php index 734496d..aed5210 100644 --- a/tests/TestKernel.php +++ b/tests/src/TestKernel.php @@ -38,7 +38,9 @@ use Rekalogika\Reconstitutor\RekalogikaReconstitutorBundle; use Rekalogika\TemporaryUrl\RekalogikaTemporaryUrlBundle; use Rekalogika\TemporaryUrl\TemporaryUrlGeneratorInterface; +use Symfony\Bundle\DebugBundle\DebugBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; +use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Filesystem\Filesystem; @@ -46,22 +48,24 @@ class TestKernel extends HttpKernelKernel { + use MicroKernelTrait { + registerContainerConfiguration as private baseRegisterContainerConfiguration; + } /** * @param array $config */ - public function __construct(private readonly array $config = []) - { - parent::__construct('test', true); + public function __construct( + private string $env = 'test', + bool $debug = true, + private readonly array $config = [], + ) { + parent::__construct($env, $debug); } #[\Override] public function boot(): void { - $filesystem = new Filesystem(); - $filesystem->remove(__DIR__ . '/../var/'); - parent::boot(); - } #[\Override] @@ -69,6 +73,7 @@ public function registerBundles(): iterable { yield new FrameworkBundle(); yield new DoctrineBundle(); + yield new DebugBundle(); yield new RekalogikaDirectPropertyAccessBundle(); yield new RekalogikaReconstitutorBundle(); yield new RekalogikaFileBundle(); @@ -76,46 +81,35 @@ public function registerBundles(): iterable yield new RekalogikaPsr16SimpleCacheBundle(); } + #[\Override] + protected function build(ContainerBuilder $container): void + { + parent::build($container); + + } + + public function getBuildDir(): string + { + return $this->getProjectDir() . '/var/build/' . $this->env; + } + #[\Override] public function registerContainerConfiguration(LoaderInterface $loader): void { - $loader->load(function (ContainerBuilder $container): void { - $container->loadFromExtension('framework', [ - 'http_method_override' => false, - 'handle_all_throwables' => true, - 'validation' => [ - 'email_validation_mode' => 'html5', - ], - 'php_errors' => [ - 'log' => true, - ], - 'http_client' => [ - 'enabled' => true, - 'max_host_connections' => 1, - 'default_options' => [ - 'timeout' => 10, - ], - ], - ]); - - $container->loadFromExtension('doctrine', [ - 'dbal' => [ - 'driver' => 'pdo_sqlite', - 'memory' => true, - 'charset' => 'UTF8', - ], - 'orm' => [ - 'enable_lazy_ghost_objects' => true, - 'controller_resolver' => [ - 'auto_mapping' => false, - ], - ], - ]); + $this->baseRegisterContainerConfiguration($loader); + $loader->load(function (ContainerBuilder $container): void { $container->loadFromExtension('rekalogika_file', $this->config); }); } + #[\Override] + public function getProjectDir(): string + { + return __DIR__ . '/../'; + } + + /** * @return iterable */ diff --git a/tests/File/FileFactory.php b/tests/src/Tests/File/FileFactory.php similarity index 98% rename from tests/File/FileFactory.php rename to tests/src/Tests/File/FileFactory.php index fa0c7f9..6f43b37 100644 --- a/tests/File/FileFactory.php +++ b/tests/src/Tests/File/FileFactory.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\File; +namespace Rekalogika\File\Tests\Tests\File; use League\Flysystem\Filesystem; use League\Flysystem\InMemory\InMemoryFilesystemAdapter; diff --git a/tests/File/FileNameTest.php b/tests/src/Tests/File/FileNameTest.php similarity index 97% rename from tests/File/FileNameTest.php rename to tests/src/Tests/File/FileNameTest.php index 1ac9b74..6abad6e 100644 --- a/tests/File/FileNameTest.php +++ b/tests/src/Tests/File/FileNameTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\File; +namespace Rekalogika\File\Tests\Tests\File; use PHPUnit\Framework\TestCase; use Rekalogika\Domain\File\Metadata\Model\FileName; diff --git a/tests/File/FileRepositoryTest.php b/tests/src/Tests/File/FileRepositoryTest.php similarity index 99% rename from tests/File/FileRepositoryTest.php rename to tests/src/Tests/File/FileRepositoryTest.php index 6f5782d..d959e4b 100644 --- a/tests/File/FileRepositoryTest.php +++ b/tests/src/Tests/File/FileRepositoryTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\File; +namespace Rekalogika\File\Tests\Tests\File; use PHPUnit\Framework\TestCase; use Rekalogika\Contracts\File\Exception\File\FileNotFoundException; diff --git a/tests/File/FileTest.php b/tests/src/Tests/File/FileTest.php similarity index 92% rename from tests/File/FileTest.php rename to tests/src/Tests/File/FileTest.php index f1bdd4a..f5f17fd 100644 --- a/tests/File/FileTest.php +++ b/tests/src/Tests/File/FileTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\File; +namespace Rekalogika\File\Tests\Tests\File; use PHPUnit\Framework\TestCase; use Rekalogika\Contracts\File\RawMetadataInterface; @@ -139,10 +139,15 @@ public function testNaming(): void ); } + /** + * @runInSeparateProcess + */ public function testOpenBasedir(): void { - $dir = realpath(__DIR__ . '/../../'); - ini_set('open_basedir', $dir . ":" . '/tmp'); + $openBaseDir = realpath(__DIR__ . '/../../../../'); + $dir = realpath(__DIR__ . '/../../../'); + ini_set('open_basedir', $openBaseDir . ":" . '/tmp'); + mkdir($dir . '/var/', 0777, true); $path = $dir . '/var/test.txt'; file_put_contents($path, 'foo'); diff --git a/tests/File/FileTestTrait.php b/tests/src/Tests/File/FileTestTrait.php similarity index 99% rename from tests/File/FileTestTrait.php rename to tests/src/Tests/File/FileTestTrait.php index b6a1070..9ce4dc5 100644 --- a/tests/File/FileTestTrait.php +++ b/tests/src/Tests/File/FileTestTrait.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\File; +namespace Rekalogika\File\Tests\Tests\File; use Rekalogika\Contracts\File\FileInterface; use Rekalogika\Contracts\File\FileMetadataInterface; diff --git a/tests/File/FileTypeTest.php b/tests/src/Tests/File/FileTypeTest.php similarity index 97% rename from tests/File/FileTypeTest.php rename to tests/src/Tests/File/FileTypeTest.php index 11632e9..b15c7d9 100644 --- a/tests/File/FileTypeTest.php +++ b/tests/src/Tests/File/FileTypeTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\File; +namespace Rekalogika\File\Tests\Tests\File; use PHPUnit\Framework\TestCase; use Rekalogika\Domain\File\Metadata\Model\MimeMapFileTypeAdapter; diff --git a/tests/File/FilesystemRepositoryTest.php b/tests/src/Tests/File/FilesystemRepositoryTest.php similarity index 97% rename from tests/File/FilesystemRepositoryTest.php rename to tests/src/Tests/File/FilesystemRepositoryTest.php index 01c83e8..b603658 100644 --- a/tests/File/FilesystemRepositoryTest.php +++ b/tests/src/Tests/File/FilesystemRepositoryTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\File; +namespace Rekalogika\File\Tests\Tests\File; use League\Flysystem\Filesystem; use League\Flysystem\FilesystemOperator; diff --git a/tests/File/FromSplFileInfoAdapterTest.php b/tests/src/Tests/File/FromSplFileInfoAdapterTest.php similarity index 95% rename from tests/File/FromSplFileInfoAdapterTest.php rename to tests/src/Tests/File/FromSplFileInfoAdapterTest.php index d11d838..4616a71 100644 --- a/tests/File/FromSplFileInfoAdapterTest.php +++ b/tests/src/Tests/File/FromSplFileInfoAdapterTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\File; +namespace Rekalogika\File\Tests\Tests\File; use PHPUnit\Framework\TestCase; use Rekalogika\File\Adapter\FromSplFileInfoAdapter; diff --git a/tests/File/MetadataSerializerTest.php b/tests/src/Tests/File/MetadataSerializerTest.php similarity index 98% rename from tests/File/MetadataSerializerTest.php rename to tests/src/Tests/File/MetadataSerializerTest.php index cc08765..be88e41 100644 --- a/tests/File/MetadataSerializerTest.php +++ b/tests/src/Tests/File/MetadataSerializerTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\File; +namespace Rekalogika\File\Tests\Tests\File; use PHPUnit\Framework\TestCase; use Rekalogika\Contracts\File\RawMetadataInterface; diff --git a/tests/File/MetadataTest.php b/tests/src/Tests/File/MetadataTest.php similarity index 98% rename from tests/File/MetadataTest.php rename to tests/src/Tests/File/MetadataTest.php index 549afa7..2eb3c39 100644 --- a/tests/File/MetadataTest.php +++ b/tests/src/Tests/File/MetadataTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\File; +namespace Rekalogika\File\Tests\Tests\File; use PHPUnit\Framework\TestCase; use Rekalogika\Domain\File\Metadata\Constants; diff --git a/tests/File/ReferenceTest.php b/tests/src/Tests/File/ReferenceTest.php similarity index 98% rename from tests/File/ReferenceTest.php rename to tests/src/Tests/File/ReferenceTest.php index cc49848..e095cf8 100644 --- a/tests/File/ReferenceTest.php +++ b/tests/src/Tests/File/ReferenceTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\File; +namespace Rekalogika\File\Tests\Tests\File; use PHPUnit\Framework\TestCase; use Rekalogika\Contracts\File\Exception\File\FileNotFoundException; diff --git a/tests/FileAssociation/DefaultFileLocationResolverTest.php b/tests/src/Tests/FileAssociation/DefaultFileLocationResolverTest.php similarity index 80% rename from tests/FileAssociation/DefaultFileLocationResolverTest.php rename to tests/src/Tests/FileAssociation/DefaultFileLocationResolverTest.php index 122b8f6..8e5e2c6 100644 --- a/tests/FileAssociation/DefaultFileLocationResolverTest.php +++ b/tests/src/Tests/FileAssociation/DefaultFileLocationResolverTest.php @@ -11,12 +11,12 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileAssociation; +namespace Rekalogika\File\Tests\Tests\FileAssociation; use PHPUnit\Framework\TestCase; use Rekalogika\File\Association\FileLocationResolver\DefaultFileLocationResolver; use Rekalogika\File\Association\ObjectIdResolver\DefaultObjectIdResolver; -use Rekalogika\File\Tests\Model\Entity; +use Rekalogika\File\Tests\Tests\Model\Entity; class DefaultFileLocationResolverTest extends TestCase { @@ -28,6 +28,6 @@ public function testDefaultLocationResolver(): void $location = $locationResolver->getFileLocation($object, 'file'); $this->assertSame('default', $location->getFilesystemIdentifier()); - $this->assertSame('entity/ffa87ef3fc5388bc8b666e2cec17d27cc493d0c1/file/50/a7/74/1b/entity_id', $location->getKey()); + $this->assertSame('entity/bf4f1cf543bb2ff30f0db7ffb4af653fcf8292b7/file/50/a7/74/1b/entity_id', $location->getKey()); } } diff --git a/tests/FileAssociation/DefaultObjectIdResolverTest.php b/tests/src/Tests/FileAssociation/DefaultObjectIdResolverTest.php similarity index 92% rename from tests/FileAssociation/DefaultObjectIdResolverTest.php rename to tests/src/Tests/FileAssociation/DefaultObjectIdResolverTest.php index 77b6fc7..2a20318 100644 --- a/tests/FileAssociation/DefaultObjectIdResolverTest.php +++ b/tests/src/Tests/FileAssociation/DefaultObjectIdResolverTest.php @@ -11,15 +11,15 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileAssociation; +namespace Rekalogika\File\Tests\Tests\FileAssociation; use PHPUnit\Framework\TestCase; use Rekalogika\File\Association\Exception\ObjectIdResolver\EmptyIdException; use Rekalogika\File\Association\Exception\ObjectIdResolver\IdNotSupportedException; use Rekalogika\File\Association\Exception\ObjectIdResolver\MethodNotFoundException; use Rekalogika\File\Association\ObjectIdResolver\DefaultObjectIdResolver; -use Rekalogika\File\Tests\Model\EntityWithAnyId; -use Rekalogika\File\Tests\Model\EntityWithoutId; +use Rekalogika\File\Tests\Tests\Model\EntityWithAnyId; +use Rekalogika\File\Tests\Tests\Model\EntityWithoutId; class DefaultObjectIdResolverTest extends TestCase { diff --git a/tests/FileAssociation/FileAssociationManagerTest.php b/tests/src/Tests/FileAssociation/FileAssociationManagerTest.php similarity index 90% rename from tests/FileAssociation/FileAssociationManagerTest.php rename to tests/src/Tests/FileAssociation/FileAssociationManagerTest.php index 576d21b..7a5930b 100644 --- a/tests/FileAssociation/FileAssociationManagerTest.php +++ b/tests/src/Tests/FileAssociation/FileAssociationManagerTest.php @@ -11,9 +11,8 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileAssociation; +namespace Rekalogika\File\Tests\Tests\FileAssociation; -use PHPUnit\Framework\TestCase; use Rekalogika\Contracts\File\Exception\File\FileNotFoundException; use Rekalogika\Contracts\File\FileProxy; use Rekalogika\Contracts\File\FileRepositoryInterface; @@ -21,13 +20,13 @@ use Rekalogika\File\Association\Model\MissingFile; use Rekalogika\File\File; use Rekalogika\File\TemporaryFile; -use Rekalogika\File\Tests\File\FileTestTrait; -use Rekalogika\File\Tests\Model\Entity; -use Rekalogika\File\Tests\Model\EntityWithLazyFile; -use Rekalogika\File\Tests\Model\EntityWithMandatoryFile; -use Rekalogika\File\Tests\TestKernel; +use Rekalogika\File\Tests\Tests\File\FileTestTrait; +use Rekalogika\File\Tests\Tests\Model\Entity; +use Rekalogika\File\Tests\Tests\Model\EntityWithLazyFile; +use Rekalogika\File\Tests\Tests\Model\EntityWithMandatoryFile; +use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; -class FileAssociationManagerTest extends TestCase +class FileAssociationManagerTest extends KernelTestCase { use FileTestTrait; @@ -38,13 +37,9 @@ class FileAssociationManagerTest extends TestCase #[\Override] protected function setUp(): void { - $kernel = new TestKernel(); - $kernel->boot(); - $container = $kernel->getContainer(); - - $fileAssociationManager = $container - ->get('test.' . FileAssociationManager::class); + $fileAssociationManager = static::getContainer() + ->get(FileAssociationManager::class); $this->assertInstanceOf( FileAssociationManager::class, $fileAssociationManager, @@ -52,8 +47,8 @@ protected function setUp(): void $this->fileAssociationManager = $fileAssociationManager; - $fileRepository = $container - ->get('test.' . FileRepositoryInterface::class); + $fileRepository = static::getContainer() + ->get(FileRepositoryInterface::class); $this->assertInstanceOf( FileRepositoryInterface::class, diff --git a/tests/FileAssociation/PropertyInspectorTest.php b/tests/src/Tests/FileAssociation/PropertyInspectorTest.php similarity index 91% rename from tests/FileAssociation/PropertyInspectorTest.php rename to tests/src/Tests/FileAssociation/PropertyInspectorTest.php index 69f3b14..dea5cc3 100644 --- a/tests/FileAssociation/PropertyInspectorTest.php +++ b/tests/src/Tests/FileAssociation/PropertyInspectorTest.php @@ -11,11 +11,11 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileAssociation; +namespace Rekalogika\File\Tests\Tests\FileAssociation; use PHPUnit\Framework\TestCase; use Rekalogika\File\Association\PropertyInspector\PropertyInspector; -use Rekalogika\File\Tests\Model\EntityWithDifferentFileProperties; +use Rekalogika\File\Tests\Tests\Model\EntityWithDifferentFileProperties; class PropertyInspectorTest extends TestCase { diff --git a/tests/FileAssociation/PropertyListerTest.php b/tests/src/Tests/FileAssociation/PropertyListerTest.php similarity index 86% rename from tests/FileAssociation/PropertyListerTest.php rename to tests/src/Tests/FileAssociation/PropertyListerTest.php index bf79063..ec6f77b 100644 --- a/tests/FileAssociation/PropertyListerTest.php +++ b/tests/src/Tests/FileAssociation/PropertyListerTest.php @@ -11,12 +11,12 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileAssociation; +namespace Rekalogika\File\Tests\Tests\FileAssociation; use PHPUnit\Framework\TestCase; use Rekalogika\File\Association\PropertyLister\AttributesPropertyLister; -use Rekalogika\File\Tests\Model\EntityWithAttribute; -use Rekalogika\File\Tests\Model\SubclassOfEntityWithAttribute; +use Rekalogika\File\Tests\Tests\Model\EntityWithAttribute; +use Rekalogika\File\Tests\Tests\Model\SubclassOfEntityWithAttribute; class PropertyListerTest extends TestCase { diff --git a/tests/FileAssociationEntity/AbstractFileTest.php b/tests/src/Tests/FileAssociationEntity/AbstractFileTest.php similarity index 95% rename from tests/FileAssociationEntity/AbstractFileTest.php rename to tests/src/Tests/FileAssociationEntity/AbstractFileTest.php index f3a670a..ac127bb 100644 --- a/tests/FileAssociationEntity/AbstractFileTest.php +++ b/tests/src/Tests/FileAssociationEntity/AbstractFileTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileAssociationEntity; +namespace Rekalogika\File\Tests\Tests\FileAssociationEntity; use PHPUnit\Framework\TestCase; use Rekalogika\Domain\File\Association\Entity\AbstractFile; @@ -19,8 +19,8 @@ use Rekalogika\Domain\File\Association\Entity\UnsetFile; use Rekalogika\Domain\File\Metadata\Constants; use Rekalogika\File\TemporaryFile; -use Rekalogika\File\Tests\File\FileTestTrait; -use Rekalogika\File\Tests\Model\EntityExtendingAbstractFile; +use Rekalogika\File\Tests\Tests\File\FileTestTrait; +use Rekalogika\File\Tests\Tests\Model\EntityExtendingAbstractFile; class AbstractFileTest extends TestCase { diff --git a/tests/FileAssociationEntity/EmbeddedMetadataTest.php b/tests/src/Tests/FileAssociationEntity/EmbeddedMetadataTest.php similarity index 95% rename from tests/FileAssociationEntity/EmbeddedMetadataTest.php rename to tests/src/Tests/FileAssociationEntity/EmbeddedMetadataTest.php index 2d53008..9965a46 100644 --- a/tests/FileAssociationEntity/EmbeddedMetadataTest.php +++ b/tests/src/Tests/FileAssociationEntity/EmbeddedMetadataTest.php @@ -11,15 +11,15 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileAssociationEntity; +namespace Rekalogika\File\Tests\Tests\FileAssociationEntity; use PHPUnit\Framework\TestCase; use Rekalogika\Contracts\File\RawMetadataInterface; use Rekalogika\Domain\File\Association\Entity\FileDecorator; use Rekalogika\Domain\File\Metadata\Constants; use Rekalogika\File\TemporaryFile; -use Rekalogika\File\Tests\File\FileTestTrait; -use Rekalogika\File\Tests\Model\EntityWithEmbeddedMetadata; +use Rekalogika\File\Tests\Tests\File\FileTestTrait; +use Rekalogika\File\Tests\Tests\Model\EntityWithEmbeddedMetadata; class EmbeddedMetadataTest extends TestCase { diff --git a/tests/FileContracts/FileProxyTest.php b/tests/src/Tests/FileContracts/FileProxyTest.php similarity index 89% rename from tests/FileContracts/FileProxyTest.php rename to tests/src/Tests/FileContracts/FileProxyTest.php index 3bdc8c9..9353092 100644 --- a/tests/FileContracts/FileProxyTest.php +++ b/tests/src/Tests/FileContracts/FileProxyTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileContracts; +namespace Rekalogika\File\Tests\Tests\FileContracts; use PHPUnit\Framework\TestCase; use Rekalogika\Contracts\File\Exception\File\FileNotFoundException; @@ -19,10 +19,10 @@ use Rekalogika\Contracts\File\FileProxy; use Rekalogika\File\FilePointer; use Rekalogika\File\TemporaryFile; -use Rekalogika\File\Tests\File\FileFactory; -use Rekalogika\File\Tests\File\FileTestTrait; -use Rekalogika\File\Tests\Model\EntityWithFileProxyUtilGetterSetter; -use Rekalogika\File\Tests\Model\EntityWithPlainGetterSetter; +use Rekalogika\File\Tests\Tests\File\FileFactory; +use Rekalogika\File\Tests\Tests\File\FileTestTrait; +use Rekalogika\File\Tests\Tests\Model\EntityWithFileProxyUtilGetterSetter; +use Rekalogika\File\Tests\Tests\Model\EntityWithPlainGetterSetter; class FileProxyTest extends TestCase { diff --git a/tests/FileImage/ImageResizerTest.php b/tests/src/Tests/FileImage/ImageResizerTest.php similarity index 93% rename from tests/FileImage/ImageResizerTest.php rename to tests/src/Tests/FileImage/ImageResizerTest.php index 25e06ee..79511a3 100644 --- a/tests/FileImage/ImageResizerTest.php +++ b/tests/src/Tests/FileImage/ImageResizerTest.php @@ -11,14 +11,14 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileImage; +namespace Rekalogika\File\Tests\Tests\FileImage; use PHPUnit\Framework\TestCase; use Rekalogika\Contracts\File\FileRepositoryInterface; use Rekalogika\Contracts\File\Metadata\ImageMetadataInterface; use Rekalogika\File\FilePointer; use Rekalogika\File\Image\ImageResizer; -use Rekalogika\File\Tests\File\FileFactory; +use Rekalogika\File\Tests\Tests\File\FileFactory; class ImageResizerTest extends TestCase { diff --git a/tests/FileNull/NullFileTest.php b/tests/src/Tests/FileNull/NullFileTest.php similarity index 98% rename from tests/FileNull/NullFileTest.php rename to tests/src/Tests/FileNull/NullFileTest.php index 4f609f8..42c098b 100644 --- a/tests/FileNull/NullFileTest.php +++ b/tests/src/Tests/FileNull/NullFileTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileNull; +namespace Rekalogika\File\Tests\Tests\FileNull; use PHPUnit\Framework\TestCase; use Rekalogika\Contracts\File\FileInterface; diff --git a/tests/src/Tests/FileServer/TemporaryUrlTest.php b/tests/src/Tests/FileServer/TemporaryUrlTest.php new file mode 100644 index 0000000..886e7ae --- /dev/null +++ b/tests/src/Tests/FileServer/TemporaryUrlTest.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +namespace Rekalogika\File\Tests\Tests\FileServer; + +use Rekalogika\File\File; +use Rekalogika\File\FilePointer; +use Rekalogika\TemporaryUrl\TemporaryUrlGeneratorInterface; +use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; + +class TemporaryUrlTest extends KernelTestCase +{ + public function testTemporaryUrlWithFilePointer(): void + { + $this->markTestSkipped(); + + // $temporaryUrlGenerator = static::getContainer() + // ->get(TemporaryUrlGeneratorInterface::class); + + // $this->assertInstanceOf( + // TemporaryUrlGeneratorInterface::class, + // $temporaryUrlGenerator, + // ); + + // $filePointer = new FilePointer('default', 'test.txt'); + // $url = $temporaryUrlGenerator->generateUrl($filePointer); + + // $this->assertStringContainsString('__route__', $url); + } + + public function testTemporaryUrlWithFile(): void + { + $this->markTestSkipped(); + + // $temporaryUrlGenerator = static::getContainer() + // ->get(TemporaryUrlGeneratorInterface::class); + + // $this->assertInstanceOf( + // TemporaryUrlGeneratorInterface::class, + // $temporaryUrlGenerator, + // ); + + // $file = new File(__DIR__ . '/../Resources/localFile.txt'); + + // $url = $temporaryUrlGenerator->generateUrl($file); + + // $this->assertStringContainsString('__route__', $url); + } +} diff --git a/tests/FileSymfonyBridge/FileAdapterTest.php b/tests/src/Tests/FileSymfonyBridge/FileAdapterTest.php similarity index 89% rename from tests/FileSymfonyBridge/FileAdapterTest.php rename to tests/src/Tests/FileSymfonyBridge/FileAdapterTest.php index 91f7d20..7135d5c 100644 --- a/tests/FileSymfonyBridge/FileAdapterTest.php +++ b/tests/src/Tests/FileSymfonyBridge/FileAdapterTest.php @@ -11,9 +11,8 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileSymfonyBridge; +namespace Rekalogika\File\Tests\Tests\FileSymfonyBridge; -use PHPUnit\Framework\TestCase; use Rekalogika\Contracts\File\FileInterface; use Rekalogika\Contracts\File\FileRepositoryInterface; use Rekalogika\File\Bridge\Symfony\HttpFoundation\FromHttpFoundationFileAdapter; @@ -21,22 +20,21 @@ use Rekalogika\File\FilePointer; use Rekalogika\File\LocalTemporaryFile; use Rekalogika\File\TemporaryFile; -use Rekalogika\File\Tests\File\FileTestTrait; -use Rekalogika\File\Tests\TestKernel; +use Rekalogika\File\Tests\Tests\File\FileTestTrait; +use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; use Symfony\Component\HttpFoundation\File\File; -class FileAdapterTest extends TestCase +class FileAdapterTest extends KernelTestCase { use FileTestTrait; private function createRemoteFile(): FileInterface { - $kernel = new TestKernel(); - $kernel->boot(); + $fileRepository = static::getContainer() + ->get(FileRepositoryInterface::class); - $container = $kernel->getContainer(); - $fileRepository = $container->get('test.' . FileRepositoryInterface::class); $this->assertInstanceOf(FileRepositoryInterface::class, $fileRepository); + return $fileRepository->createFromString(new FilePointer('default', 'key'), 'asdf'); } diff --git a/tests/FileSymfonyBridge/FileExtensionTest.php b/tests/src/Tests/FileSymfonyBridge/FileExtensionTest.php similarity index 94% rename from tests/FileSymfonyBridge/FileExtensionTest.php rename to tests/src/Tests/FileSymfonyBridge/FileExtensionTest.php index 6865b9f..e87442d 100644 --- a/tests/FileSymfonyBridge/FileExtensionTest.php +++ b/tests/src/Tests/FileSymfonyBridge/FileExtensionTest.php @@ -11,12 +11,12 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileSymfonyBridge; +namespace Rekalogika\File\Tests\Tests\FileSymfonyBridge; use Rekalogika\Contracts\File\FileInterface; use Rekalogika\File\Bridge\Symfony\Form\FileTypeExtension; use Rekalogika\File\LocalTemporaryFile; -use Rekalogika\File\Tests\File\FileTestTrait; +use Rekalogika\File\Tests\Tests\File\FileTestTrait; use Symfony\Component\Form\Extension\Core\Type\FileType; use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler; use Symfony\Component\Form\Test\TypeTestCase; diff --git a/tests/FileSymfonyBridge/FileResponseTest.php b/tests/src/Tests/FileSymfonyBridge/FileResponseTest.php similarity index 97% rename from tests/FileSymfonyBridge/FileResponseTest.php rename to tests/src/Tests/FileSymfonyBridge/FileResponseTest.php index 56dd3ee..435fa85 100644 --- a/tests/FileSymfonyBridge/FileResponseTest.php +++ b/tests/src/Tests/FileSymfonyBridge/FileResponseTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileSymfonyBridge; +namespace Rekalogika\File\Tests\Tests\FileSymfonyBridge; use PHPUnit\Framework\TestCase; use Rekalogika\File\Bridge\Symfony\HttpFoundation\FileResponse; diff --git a/tests/FileSymfonyBridge/FileTransformerTest.php b/tests/src/Tests/FileSymfonyBridge/FileTransformerTest.php similarity index 95% rename from tests/FileSymfonyBridge/FileTransformerTest.php rename to tests/src/Tests/FileSymfonyBridge/FileTransformerTest.php index d59f301..5a30f46 100644 --- a/tests/FileSymfonyBridge/FileTransformerTest.php +++ b/tests/src/Tests/FileSymfonyBridge/FileTransformerTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileSymfonyBridge; +namespace Rekalogika\File\Tests\Tests\FileSymfonyBridge; use PHPUnit\Framework\TestCase; use Rekalogika\File\Bridge\Symfony\Form\FileTransformer; diff --git a/tests/FileSymfonyBridge/FileTypeTest.php b/tests/src/Tests/FileSymfonyBridge/FileTypeTest.php similarity index 93% rename from tests/FileSymfonyBridge/FileTypeTest.php rename to tests/src/Tests/FileSymfonyBridge/FileTypeTest.php index 57fa049..7abb348 100644 --- a/tests/FileSymfonyBridge/FileTypeTest.php +++ b/tests/src/Tests/FileSymfonyBridge/FileTypeTest.php @@ -11,12 +11,12 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileSymfonyBridge; +namespace Rekalogika\File\Tests\Tests\FileSymfonyBridge; use Rekalogika\Contracts\File\FileInterface; use Rekalogika\File\Bridge\Symfony\Form\FileType; use Rekalogika\File\LocalTemporaryFile; -use Rekalogika\File\Tests\File\FileTestTrait; +use Rekalogika\File\Tests\Tests\File\FileTestTrait; use Symfony\Component\Form\Extension\HttpFoundation\HttpFoundationRequestHandler; use Symfony\Component\Form\Test\TypeTestCase; use Symfony\Component\HttpFoundation\File\UploadedFile; diff --git a/tests/FileSymfonyBridge/FileValidatorTest.php b/tests/src/Tests/FileSymfonyBridge/FileValidatorTest.php similarity index 97% rename from tests/FileSymfonyBridge/FileValidatorTest.php rename to tests/src/Tests/FileSymfonyBridge/FileValidatorTest.php index 03fcdbb..618b488 100644 --- a/tests/FileSymfonyBridge/FileValidatorTest.php +++ b/tests/src/Tests/FileSymfonyBridge/FileValidatorTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileSymfonyBridge; +namespace Rekalogika\File\Tests\Tests\FileSymfonyBridge; use Rekalogika\File\Bridge\Symfony\Constraints\File; use Rekalogika\File\Bridge\Symfony\Constraints\FileValidator; diff --git a/tests/FileSymfonyBridge/ImageValidatorTest.php b/tests/src/Tests/FileSymfonyBridge/ImageValidatorTest.php similarity index 96% rename from tests/FileSymfonyBridge/ImageValidatorTest.php rename to tests/src/Tests/FileSymfonyBridge/ImageValidatorTest.php index 36e45db..1b3097e 100644 --- a/tests/FileSymfonyBridge/ImageValidatorTest.php +++ b/tests/src/Tests/FileSymfonyBridge/ImageValidatorTest.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileSymfonyBridge; +namespace Rekalogika\File\Tests\Tests\FileSymfonyBridge; use Rekalogika\File\Bridge\Symfony\Constraints\Image; use Rekalogika\File\Bridge\Symfony\Constraints\ImageValidator; diff --git a/tests/FileZip/ZipTest.php b/tests/src/Tests/FileZip/ZipTest.php similarity index 90% rename from tests/FileZip/ZipTest.php rename to tests/src/Tests/FileZip/ZipTest.php index 93d497a..eea4584 100644 --- a/tests/FileZip/ZipTest.php +++ b/tests/src/Tests/FileZip/ZipTest.php @@ -11,17 +11,16 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\FileZip; +namespace Rekalogika\File\Tests\Tests\FileZip; -use PHPUnit\Framework\TestCase; use Rekalogika\Contracts\File\FileInterface; use Rekalogika\Contracts\File\FileRepositoryInterface; use Rekalogika\File\FilePointer; -use Rekalogika\File\Tests\TestKernel; use Rekalogika\File\Zip\FileZip; use Rekalogika\File\Zip\Model\Directory; +use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; -class ZipTest extends TestCase +class ZipTest extends KernelTestCase { private ?FileRepositoryInterface $fileRepository = null; @@ -30,13 +29,8 @@ class ZipTest extends TestCase #[\Override] protected function setUp(): void { - $kernel = new TestKernel(); - $kernel->boot(); - - $container = $kernel->getContainer(); - - $fileRepository = $container - ->get('test.' . FileRepositoryInterface::class); + $fileRepository = static::getContainer() + ->get(FileRepositoryInterface::class); $this->assertInstanceOf( FileRepositoryInterface::class, @@ -45,8 +39,8 @@ protected function setUp(): void $this->fileRepository = $fileRepository; - $fileZip = $container - ->get('test.' . FileZip::class); + $fileZip = static::getContainer() + ->get(FileZip::class); $this->assertInstanceOf( FileZip::class, diff --git a/tests/Model/Entity.php b/tests/src/Tests/Model/Entity.php similarity index 95% rename from tests/Model/Entity.php rename to tests/src/Tests/Model/Entity.php index baa504a..212e51d 100644 --- a/tests/Model/Entity.php +++ b/tests/src/Tests/Model/Entity.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\Model; +namespace Rekalogika\File\Tests\Tests\Model; use Rekalogika\Contracts\File\Association\FileAssociationInterface; use Rekalogika\Contracts\File\FileInterface; diff --git a/tests/Model/EntityExtendingAbstractFile.php b/tests/src/Tests/Model/EntityExtendingAbstractFile.php similarity index 90% rename from tests/Model/EntityExtendingAbstractFile.php rename to tests/src/Tests/Model/EntityExtendingAbstractFile.php index 5fe1526..56e5941 100644 --- a/tests/Model/EntityExtendingAbstractFile.php +++ b/tests/src/Tests/Model/EntityExtendingAbstractFile.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\Model; +namespace Rekalogika\File\Tests\Tests\Model; use Doctrine\ORM\Mapping\Entity; use Rekalogika\Domain\File\Association\Entity\AbstractFile; diff --git a/tests/Model/EntityWithAnyId.php b/tests/src/Tests/Model/EntityWithAnyId.php similarity index 91% rename from tests/Model/EntityWithAnyId.php rename to tests/src/Tests/Model/EntityWithAnyId.php index 541b795..cdd0584 100644 --- a/tests/Model/EntityWithAnyId.php +++ b/tests/src/Tests/Model/EntityWithAnyId.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\Model; +namespace Rekalogika\File\Tests\Tests\Model; class EntityWithAnyId { diff --git a/tests/Model/EntityWithAttribute.php b/tests/src/Tests/Model/EntityWithAttribute.php similarity index 96% rename from tests/Model/EntityWithAttribute.php rename to tests/src/Tests/Model/EntityWithAttribute.php index 83534d6..44ed8c4 100644 --- a/tests/Model/EntityWithAttribute.php +++ b/tests/src/Tests/Model/EntityWithAttribute.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\Model; +namespace Rekalogika\File\Tests\Tests\Model; use Rekalogika\Contracts\File\FileInterface; use Rekalogika\File\Association\Attribute\AsFileAssociation; diff --git a/tests/Model/EntityWithDifferentFileProperties.php b/tests/src/Tests/Model/EntityWithDifferentFileProperties.php similarity index 95% rename from tests/Model/EntityWithDifferentFileProperties.php rename to tests/src/Tests/Model/EntityWithDifferentFileProperties.php index 934c394..2a272b2 100644 --- a/tests/Model/EntityWithDifferentFileProperties.php +++ b/tests/src/Tests/Model/EntityWithDifferentFileProperties.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\Model; +namespace Rekalogika\File\Tests\Tests\Model; use Rekalogika\Contracts\File\FileInterface; use Rekalogika\File\Association\Attribute\AsFileAssociation; diff --git a/tests/Model/EntityWithEmbeddedMetadata.php b/tests/src/Tests/Model/EntityWithEmbeddedMetadata.php similarity index 97% rename from tests/Model/EntityWithEmbeddedMetadata.php rename to tests/src/Tests/Model/EntityWithEmbeddedMetadata.php index 214a4d2..a68c159 100644 --- a/tests/Model/EntityWithEmbeddedMetadata.php +++ b/tests/src/Tests/Model/EntityWithEmbeddedMetadata.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\Model; +namespace Rekalogika\File\Tests\Tests\Model; use Doctrine\ORM\Mapping\Embedded; use Doctrine\ORM\Mapping\Entity; diff --git a/tests/Model/EntityWithFileProxyUtilGetterSetter.php b/tests/src/Tests/Model/EntityWithFileProxyUtilGetterSetter.php similarity index 94% rename from tests/Model/EntityWithFileProxyUtilGetterSetter.php rename to tests/src/Tests/Model/EntityWithFileProxyUtilGetterSetter.php index f157eb1..69287e4 100644 --- a/tests/Model/EntityWithFileProxyUtilGetterSetter.php +++ b/tests/src/Tests/Model/EntityWithFileProxyUtilGetterSetter.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\Model; +namespace Rekalogika\File\Tests\Tests\Model; use Rekalogika\Contracts\File\FileInterface; use Rekalogika\Contracts\File\FileProxy; diff --git a/tests/Model/EntityWithLazyFile.php b/tests/src/Tests/Model/EntityWithLazyFile.php similarity index 95% rename from tests/Model/EntityWithLazyFile.php rename to tests/src/Tests/Model/EntityWithLazyFile.php index 3e78362..e2d0d7f 100644 --- a/tests/Model/EntityWithLazyFile.php +++ b/tests/src/Tests/Model/EntityWithLazyFile.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\Model; +namespace Rekalogika\File\Tests\Tests\Model; use Rekalogika\Contracts\File\FileInterface; use Rekalogika\File\Association\Attribute\AsFileAssociation; diff --git a/tests/Model/EntityWithMandatoryFile.php b/tests/src/Tests/Model/EntityWithMandatoryFile.php similarity index 95% rename from tests/Model/EntityWithMandatoryFile.php rename to tests/src/Tests/Model/EntityWithMandatoryFile.php index 3b29854..938fd41 100644 --- a/tests/Model/EntityWithMandatoryFile.php +++ b/tests/src/Tests/Model/EntityWithMandatoryFile.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\Model; +namespace Rekalogika\File\Tests\Tests\Model; use Rekalogika\Contracts\File\FileInterface; use Rekalogika\File\Association\Attribute\AsFileAssociation; diff --git a/tests/Model/EntityWithPlainGetterSetter.php b/tests/src/Tests/Model/EntityWithPlainGetterSetter.php similarity index 93% rename from tests/Model/EntityWithPlainGetterSetter.php rename to tests/src/Tests/Model/EntityWithPlainGetterSetter.php index 3784073..97e4610 100644 --- a/tests/Model/EntityWithPlainGetterSetter.php +++ b/tests/src/Tests/Model/EntityWithPlainGetterSetter.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\Model; +namespace Rekalogika\File\Tests\Tests\Model; use Rekalogika\Contracts\File\FileInterface; diff --git a/tests/Model/EntityWithoutId.php b/tests/src/Tests/Model/EntityWithoutId.php similarity index 93% rename from tests/Model/EntityWithoutId.php rename to tests/src/Tests/Model/EntityWithoutId.php index ac89074..d15d0e2 100644 --- a/tests/Model/EntityWithoutId.php +++ b/tests/src/Tests/Model/EntityWithoutId.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\Model; +namespace Rekalogika\File\Tests\Tests\Model; use Rekalogika\Contracts\File\FileInterface; diff --git a/tests/Model/SubclassOfEntityWithAttribute.php b/tests/src/Tests/Model/SubclassOfEntityWithAttribute.php similarity index 96% rename from tests/Model/SubclassOfEntityWithAttribute.php rename to tests/src/Tests/Model/SubclassOfEntityWithAttribute.php index 9fd26a7..a5dae87 100644 --- a/tests/Model/SubclassOfEntityWithAttribute.php +++ b/tests/src/Tests/Model/SubclassOfEntityWithAttribute.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\File\Tests\Model; +namespace Rekalogika\File\Tests\Tests\Model; use Rekalogika\Contracts\File\FileInterface; use Rekalogika\File\Association\Attribute\AsFileAssociation; diff --git a/tests/Resources/legacyImageMetadata.json b/tests/src/Tests/Resources/legacyImageMetadata.json similarity index 100% rename from tests/Resources/legacyImageMetadata.json rename to tests/src/Tests/Resources/legacyImageMetadata.json diff --git a/tests/Resources/legacyMetadata.json b/tests/src/Tests/Resources/legacyMetadata.json similarity index 100% rename from tests/Resources/legacyMetadata.json rename to tests/src/Tests/Resources/legacyMetadata.json diff --git a/tests/Resources/localFile.txt b/tests/src/Tests/Resources/localFile.txt similarity index 100% rename from tests/Resources/localFile.txt rename to tests/src/Tests/Resources/localFile.txt diff --git a/tests/Resources/smiley.png b/tests/src/Tests/Resources/smiley.png similarity index 100% rename from tests/Resources/smiley.png rename to tests/src/Tests/Resources/smiley.png