-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor: fix foundry deprecations (#46)
- Loading branch information
Showing
5 changed files
with
15 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,7 @@ | |
use Zenstruck\Foundry\Test\Factories; | ||
use Zenstruck\Foundry\Test\ResetDatabase; | ||
use Zenstruck\RedirectBundle\Tests\Fixture\Entity\DummyNotFound; | ||
|
||
use function Zenstruck\Foundry\repository; | ||
use function Zenstruck\Foundry\Persistence\repository; | ||
|
||
/** | ||
* @author Kevin Bond <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,7 @@ | |
use Zenstruck\Foundry\Test\Factories; | ||
use Zenstruck\Foundry\Test\ResetDatabase; | ||
use Zenstruck\RedirectBundle\Tests\Fixture\Entity\DummyRedirect; | ||
|
||
use function Zenstruck\Foundry\create; | ||
use function Zenstruck\Foundry\Persistence\persist_proxy; | ||
|
||
/** | ||
* @author Kevin Bond <[email protected]> | ||
|
@@ -31,7 +30,7 @@ final class RedirectTest extends KernelTestCase | |
*/ | ||
public function permanent_redirect(): void | ||
{ | ||
$redirect = create(DummyRedirect::class, ['source' => '/301-redirect', 'destination' => '/']); | ||
$redirect = persist_proxy(DummyRedirect::class, ['source' => '/301-redirect', 'destination' => '/']); | ||
$browser = $this->browser()->interceptRedirects(); | ||
|
||
$this->assertSame(0, $redirect->getCount()); | ||
|
@@ -56,7 +55,7 @@ public function permanent_redirect(): void | |
*/ | ||
public function temporary_redirect(): void | ||
{ | ||
$redirect = create(DummyRedirect::class, [ | ||
$redirect = persist_proxy(DummyRedirect::class, [ | ||
'source' => '/302-redirect', | ||
'destination' => '/', | ||
'permanent' => false, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,10 @@ | |
use Zenstruck\Foundry\Test\ResetDatabase; | ||
use Zenstruck\RedirectBundle\Tests\Fixture\Entity\DummyNotFound; | ||
use Zenstruck\RedirectBundle\Tests\Fixture\Entity\DummyRedirect; | ||
use function Zenstruck\Foundry\Persistence\persist; | ||
use function Zenstruck\Foundry\Persistence\persist_proxy; | ||
use function Zenstruck\Foundry\Persistence\repository; | ||
|
||
use function Zenstruck\Foundry\create; | ||
use function Zenstruck\Foundry\repository; | ||
|
||
/** | ||
* @author Kevin Bond <[email protected]> | ||
|
@@ -35,7 +36,7 @@ public function delete_not_found_on_create_redirect(): void | |
{ | ||
$notFoundRepo = repository(DummyNotFound::class); | ||
|
||
create(DummyNotFound::class, ['path' => '/foo', 'fullUrl' => '/foo']); | ||
persist(DummyNotFound::class, ['path' => '/foo', 'fullUrl' => '/foo']); | ||
|
||
$notFoundRepo->assert()->count(1); | ||
|
||
|
@@ -53,14 +54,14 @@ public function delete_not_found_on_update_redirect(): void | |
{ | ||
$notFoundRepo = repository(DummyNotFound::class); | ||
|
||
create(DummyNotFound::class, ['path' => '/foo', 'fullUrl' => '/foo']); | ||
persist(DummyNotFound::class, ['path' => '/foo', 'fullUrl' => '/foo']); | ||
|
||
$redirect = create(DummyRedirect::class, ['source' => '/baz', 'destination' => '/bar']); | ||
$redirect = persist_proxy(DummyRedirect::class, ['source' => '/baz', 'destination' => '/bar']); | ||
|
||
$notFoundRepo->assert()->count(1); | ||
|
||
$redirect->setSource('/foo'); | ||
$redirect->save(); | ||
$redirect->_save(); | ||
|
||
$notFoundRepo->assert()->empty(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,8 @@ | |
use Zenstruck\Foundry\Test\ResetDatabase; | ||
use Zenstruck\RedirectBundle\Tests\Fixture\Entity\DummyRedirect; | ||
|
||
use function Zenstruck\Foundry\create; | ||
use function Zenstruck\Foundry\Persistence\persist; | ||
|
||
|
||
/** | ||
* @author Kevin Bond <[email protected]> | ||
|
@@ -31,7 +32,7 @@ final class ValidationTest extends KernelTestCase | |
*/ | ||
public function validation(): void | ||
{ | ||
create(DummyRedirect::class, ['source' => '/301-redirect', 'destination' => '/bar']); | ||
persist(DummyRedirect::class, ['source' => '/301-redirect', 'destination' => '/bar']); | ||
|
||
/** @var RecursiveValidator $validator */ | ||
$validator = self::getContainer()->get('validator'); | ||
|