mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
Test : Check if class Chill\ReportBundle\Entity\Report is in chill_custom_fields.customizables_entities
This commit is contained in:
parent
2e89acfcb6
commit
005e56c72a
29
Tests/DependencyInjection/ChillReportExtensionTest.php
Normal file
29
Tests/DependencyInjection/ChillReportExtensionTest.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\ReportBundle\Tests\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
|
||||
class ChillReportExtensionTest extends KernelTestCase
|
||||
{
|
||||
/*
|
||||
* Check if class Chill\ReportBundle\Entity\Report is in chill_custom_fields.customizables_entities
|
||||
*/
|
||||
public function testDeclareReportAsCustomizable()
|
||||
{
|
||||
self::bootKernel(array('environment' => 'test'));
|
||||
$customizablesEntities = static::$kernel->getContainer()
|
||||
->getParameter('chill_custom_fields.customizables_entities');
|
||||
|
||||
$reportFounded = false;
|
||||
foreach ($customizablesEntities as $customizablesEntity) {
|
||||
if($customizablesEntity['class'] === 'Chill\ReportBundle\Entity\Report') {
|
||||
$reportFounded = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(! $reportFounded) {
|
||||
throw new Exception("Class Chill\ReportBundle\Entity\Report not found in chill_custom_fields.customizables_entities", 1);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user