Skip to content

Commit d9666c4

Browse files
committed
foundry 2.0
1 parent 6d3ca10 commit d9666c4

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"twig/twig": "^3.6",
4949
"zenstruck/assert": "^1.2",
5050
"zenstruck/console-test": "^1.4",
51-
"zenstruck/foundry": "^1.30.3"
51+
"zenstruck/foundry": "^2.3.10"
5252
},
5353
"config": {
5454
"preferred-install": "dist",

tests/Filesystem/Doctrine/EventListener/Entity1NodeLifecycleListenerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Zenstruck\Filesystem\Node\File\LazyFile;
1717
use Zenstruck\Tests\Fixtures\Entity\Entity1;
1818

19-
use function Zenstruck\Foundry\repository;
19+
use function Zenstruck\Foundry\Persistence\repository;
2020

2121
/**
2222
* @author Kevin Bond <kevinbond@gmail.com>
@@ -42,7 +42,7 @@ public function files_autoloaded(): void
4242
$this->flushAndAssertNoChangesFor($object);
4343
$this->em()->clear();
4444

45-
$fromDb = repository($class)->first()->object();
45+
$fromDb = repository($class)->first();
4646

4747
$this->assertInstanceOf(LazyFile::class, $fromDb->getFile1());
4848
$this->assertSame('content1', $fromDb->getFile1()->contents());

tests/Filesystem/Doctrine/EventListener/NodeLifecycleListenerTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Zenstruck\Filesystem\Node\File\PendingFile;
1818
use Zenstruck\Tests\Filesystem\Doctrine\DoctrineTestCase;
1919

20-
use function Zenstruck\Foundry\repository;
20+
use function Zenstruck\Foundry\Persistence\repository;
2121

2222
/**
2323
* @author Kevin Bond <kevinbond@gmail.com>
@@ -56,7 +56,7 @@ public function files_deleted_on_remove(int $num): void
5656
$this->filesystem()->assertExists('some/file.txt');
5757
$this->filesystem()->assertExists('some/image.png');
5858

59-
$fromDb = repository($class)->first()->object();
59+
$fromDb = repository($class)->first();
6060

6161
$this->em()->remove($fromDb);
6262
$this->em()->flush();
@@ -87,7 +87,7 @@ public function files_deleted_on_change(int $num): void
8787
$this->filesystem()->assertExists('some/file.txt');
8888
$this->filesystem()->assertExists('some/image.png');
8989

90-
$fromDb = repository($class)->first()->object();
90+
$fromDb = repository($class)->first();
9191

9292
$fromDb->{'setFile'.$num}($this->filesystem()->write('some/new-file.txt', 'content3'));
9393
$object->{'setImage'.$num}($this->filesystem()->write('some/new-image.png', fixture('metadata.jpg'))->ensureImage());
@@ -118,7 +118,7 @@ public function files_deleted_on_set_null(int $num): void
118118
$this->filesystem()->assertExists('some/file.txt');
119119
$this->filesystem()->assertExists('some/image.png');
120120

121-
$fromDb = repository($class)->first()->object();
121+
$fromDb = repository($class)->first();
122122

123123
$fromDb->{'setFile'.$num}(null);
124124
$object->{'setImage'.$num}(null);
@@ -149,7 +149,7 @@ public function files_stored_as_path_not_deleted_if_path_the_same(int $num): voi
149149
$this->flushAndAssertNoChangesFor($object);
150150
$this->em()->clear();
151151

152-
$fromDb = repository($class)->first()->object();
152+
$fromDb = repository($class)->first();
153153

154154
$this->assertSame('new content', $this->loadMappingFor($fromDb)->{'getFile'.$num}()->contents());
155155
}
@@ -272,7 +272,7 @@ public function metadata_is_pulled_from_attributes(): void
272272

273273
$this->filesystem()->delete('some/image.png');
274274

275-
$fromDb = repository($class)->first()->object();
275+
$fromDb = repository($class)->first();
276276

277277
/** @var Image $image */
278278
$image = $fromDb->getImage4();
@@ -325,7 +325,7 @@ public function persist_and_update_file_with_different_filesystem(): void
325325
$this->em()->flush();
326326
$this->em()->clear();
327327

328-
$fromDb = repository($class)->first()->object();
328+
$fromDb = repository($class)->first();
329329
$this->loadMappingFor($fromDb);
330330

331331
$file = $fromDb->getFile1();
@@ -339,7 +339,7 @@ public function persist_and_update_file_with_different_filesystem(): void
339339
$this->em()->flush();
340340
$this->em()->clear();
341341

342-
$fromDb = repository($class)->first()->object();
342+
$fromDb = repository($class)->first();
343343
$this->loadMappingFor($fromDb);
344344

345345
$file = $fromDb->getFile1();

tests/Filesystem/Doctrine/MappingManagerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Zenstruck\Filesystem\Node\File\LazyFile;
1919
use Zenstruck\Tests\Fixtures\Entity\Entity2;
2020

21-
use function Zenstruck\Foundry\repository;
21+
use function Zenstruck\Foundry\Persistence\repository;
2222

2323
/**
2424
* @author Kevin Bond <kevinbond@gmail.com>
@@ -49,7 +49,7 @@ public function can_load_files_for_object(): void
4949
$this->flushAndAssertNoChangesFor($object);
5050
$this->em()->clear();
5151

52-
$fromDb = repository(Entity2::class)->first()->object();
52+
$fromDb = repository(Entity2::class)->first();
5353
$fromDb = $this->mappingContext()->load($fromDb);
5454
$fromDb = $this->mappingContext()->load($fromDb); // ensure multiple calls work
5555
$this->mappingContext()->load([$fromDb]);

0 commit comments

Comments
 (0)