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 38d0749..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", diff --git a/tests/config/packages/doctrine.yaml b/tests/config/packages/doctrine.yaml index ae07a4f..96549d4 100644 --- a/tests/config/packages/doctrine.yaml +++ b/tests/config/packages/doctrine.yaml @@ -11,10 +11,10 @@ doctrine: 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/Fixtures/Doctrine" - # prefix: 'Rekalogika\File\Tests\Fixtures\Doctrine' - # alias: App + mappings: + App: + is_bundle: false + type: attribute + dir: "%kernel.project_dir%/src/Entity" + prefix: 'Rekalogika\File\Tests\Entity' + alias: App 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/src/TestKernel.php b/tests/src/TestKernel.php index 5631dd5..aed5210 100644 --- a/tests/src/TestKernel.php +++ b/tests/src/TestKernel.php @@ -65,11 +65,7 @@ public function __construct( #[\Override] public function boot(): void { - $filesystem = new Filesystem(); - $filesystem->remove(__DIR__ . '/../var/'); - parent::boot(); - } #[\Override]