Completed
Branch custom_translations (7e9ce6)
by Antonio
08:29
created

TableGuesserTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 9
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testTableGuesserIsTaggedCorrectly() 0 14 1
1
<?php
2
3
namespace Flagbit\Bundle\TableAttributeBundle\Tests\Validator\ConstraintGuesser;
4
5
use Flagbit\Bundle\TableAttributeBundle\Validator\Constraints\Table;
6
use Pim\Bundle\CatalogBundle\Entity\Attribute;
7
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
8
9
class TableGuesserTest extends KernelTestCase
10
{
11
    public function testTableGuesserIsTaggedCorrectly()
12
    {
13
        self::bootKernel();
14
        $container = self::$kernel->getContainer();
15
16
        $chainedAttributeConstraintGuesser = $container->get('pim_catalog.validator.constraint_guesser.chained_attribute');
17
18
        $attribute = new Attribute();
19
        $attribute->setAttributeType('flagbit_catalog_table');
20
21
        $constraintGuesser = $chainedAttributeConstraintGuesser->guessConstraints($attribute);
22
23
        self::assertCount(1, $constraintGuesser);
24
        self::assertInstanceOf(Table::class, $constraintGuesser[0]);
25
    }
26
}
27