-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add AdminTestCase * Test * add missing tests
- Loading branch information
1 parent
4cc6c62
commit 6f8d1b5
Showing
26 changed files
with
560 additions
and
51 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
50 changes: 50 additions & 0 deletions
50
packages/basic-page-bundle/tests/Integration/BasicPageAdminTest.php
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,50 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Runroom package. | ||
* | ||
* (c) Runroom <runroom@runroom.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Runroom\BasicPageBundle\Tests\Integration; | ||
|
||
use Runroom\BasicPageBundle\Admin\BasicPageAdmin; | ||
use Runroom\Testing\TestCase\SonataAdminTestCase; | ||
|
||
class BasicPageAdminTest extends SonataAdminTestCase | ||
{ | ||
/** @test */ | ||
public function itHasAllListFields(): void | ||
{ | ||
$this->assertAdminListContainsField('title'); | ||
$this->assertAdminListContainsField('location'); | ||
$this->assertAdminListContainsField('publish'); | ||
$this->assertAdminListContainsField('_action'); | ||
} | ||
|
||
/** @test */ | ||
public function itHasAllFormFields(): void | ||
{ | ||
$this->assertAdminFormContainsField('translations'); | ||
$this->assertAdminFormContainsField('publish'); | ||
$this->assertAdminFormContainsField('location'); | ||
$this->assertAdminFormContainsField('metaInformation'); | ||
} | ||
|
||
/** @test */ | ||
public function itHasAllFilterFields(): void | ||
{ | ||
$this->assertAdminFilterContainsField('translations.title'); | ||
$this->assertAdminFilterContainsField('publish'); | ||
} | ||
|
||
protected function getAdminClass(): string | ||
{ | ||
return BasicPageAdmin::class; | ||
} | ||
} |
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
42 changes: 42 additions & 0 deletions
42
packages/cookies-bundle/tests/Integration/CookiesPageAdminTest.php
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,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the Runroom package. | ||
* | ||
* (c) Runroom <runroom@runroom.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Runroom\CookiesPageBundle\Tests\Integration; | ||
|
||
use Runroom\CookiesBundle\Admin\CookiesPageAdmin; | ||
use Runroom\Testing\TestCase\SonataAdminTestCase; | ||
|
||
class CookiesPageAdminTest extends SonataAdminTestCase | ||
{ | ||
/** @test */ | ||
public function itHasAllFormFields(): void | ||
{ | ||
$this->assertAdminFormContainsField('translations'); | ||
} | ||
|
||
/** @test */ | ||
public function itDoesNotHaveDisabledRoutes(): void | ||
{ | ||
$this->assertAdminRoutesDoesContainRoute('edit'); | ||
$this->assertAdminRoutesDoesNotContainRoute('show'); | ||
$this->assertAdminRoutesDoesNotContainRoute('delete'); | ||
$this->assertAdminRoutesDoesNotContainRoute('list'); | ||
$this->assertAdminRoutesDoesNotContainRoute('batch'); | ||
$this->assertAdminRoutesDoesNotContainRoute('export'); | ||
} | ||
|
||
protected function getAdminClass(): string | ||
{ | ||
return CookiesPageAdmin::class; | ||
} | ||
} |
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
Oops, something went wrong.