-
-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
316 additions
and
42 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
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
framework: | ||
session: | ||
storage_id: session.storage.mock_file |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
security: | ||
enable_authenticator_manager: true | ||
|
||
framework: | ||
session: | ||
storage_factory_id: session.storage.factory.mock_file |
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 |
---|---|---|
@@ -1,3 +1,16 @@ | ||
test_page: | ||
path: /u_truncate_test | ||
controller: Sonata\MediaBundle\Tests\App\Controller\TruncateController::test | ||
|
||
admin_area: | ||
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml' | ||
prefix: /admin | ||
|
||
_sonata_admin: | ||
resource: . | ||
type: sonata_admin | ||
prefix: /admin | ||
|
||
media: | ||
resource: '@SonataMediaBundle/Resources/config/routing/media.xml' | ||
prefix: /media |
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Sonata Project package. | ||
* | ||
* (c) Thomas Rabaix <thomas.rabaix@sonata-project.org> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Sonata\ClassificationBundle\Tests\App\Action; | ||
|
||
use Doctrine\ORM\EntityManagerInterface; | ||
use Sonata\MediaBundle\Tests\App\AppKernel; | ||
use Sonata\MediaBundle\Tests\App\Entity\Gallery; | ||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
|
||
final class GalleryAdminTest extends WebTestCase | ||
{ | ||
/** | ||
* @dataProvider provideCrudUrlsCases | ||
*/ | ||
public function testCrudUrls(string $url): void | ||
{ | ||
$client = self::createClient(); | ||
|
||
$this->prepareData(); | ||
|
||
$client->request('GET', $url); | ||
|
||
self::assertResponseIsSuccessful(); | ||
} | ||
|
||
/** | ||
* @return iterable<string[]> | ||
* | ||
* @phpstan-return iterable<array{string}> | ||
*/ | ||
public static function provideCrudUrlsCases(): iterable | ||
{ | ||
yield 'List Gallery' => ['/admin/tests/app/gallery/list']; | ||
yield 'Create Gallery' => ['/admin/tests/app/gallery/create']; | ||
yield 'Edit Gallery' => ['/admin/tests/app/gallery/1/edit']; | ||
} | ||
|
||
/** | ||
* @return class-string<\Symfony\Component\HttpKernel\KernelInterface> | ||
*/ | ||
protected static function getKernelClass(): string | ||
{ | ||
return AppKernel::class; | ||
} | ||
|
||
private function prepareData(): void | ||
{ | ||
// TODO: Simplify this when dropping support for Symfony 4. | ||
// @phpstan-ignore-next-line | ||
$container = method_exists($this, 'getContainer') ? self::getContainer() : self::$container; | ||
$manager = $container->get('doctrine.orm.entity_manager'); | ||
\assert($manager instanceof EntityManagerInterface); | ||
|
||
$gallery = new Gallery(); | ||
$gallery->setName('name'); | ||
$gallery->setContext('default'); | ||
|
||
$manager->persist($gallery); | ||
$manager->flush(); | ||
} | ||
} |
Oops, something went wrong.