use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface;
use Symfony\Component\Validator\Mapping\Loader\AttributeLoader;
use Symfony\Component\Validator\Tests\Dummy\DummyClassOne;
/**
* @author Loïc Frémont <lc.fremont@gmail.com>
*/
class DebugCommandTest extends TestCase
{ public function testOutputWithClassArgument() { $command =
new DebugCommand(new LazyLoadingMetadataFactory(new AttributeLoader()));
$tester =
new CommandTester($command);
$tester->
execute(['class' => DummyClassOne::
class],
['decorated' => false
]);
$this->
assertSame(<<<TXT
Symfony\Component\Validator\Tests\Dummy\DummyClassOne
-----------------------------------------------------
+---------------+----------------------------------------------------+------------------------+------------------------------------------------------------+
| Property | Name | Groups | Options |
+---------------+----------------------------------------------------+------------------------+------------------------------------------------------------+
| - | Symfony\Component\Validator\Constraints\Expression | Default, DummyClassOne | [ |
| | | | "expression" => "1 + 1 = 2", |
| | | | "message" => "This value is not valid.", |
| | | | "negate" => true, |
| | | | "payload" => null, |
| | | | "values" => [] |
| | | | ] |
| code | property options | | [ |
| | | | "cascadeStrategy" => "None", |
| | | | "autoMappingStrategy" => "None", |
| | | | "traversalStrategy" => "None" |
| | | | ] |
| code | Symfony\Component\Validator\Constraints\NotBlank | Default, DummyClassOne | [ |
| | | | "allowNull" => false, |
| | | | "message" => "This value should not be blank.", |
| | | | "normalizer" => null, |
| | | | "payload" => null |
| | | | ] |
| email | property options | | [ |
| | | | "cascadeStrategy" => "None", |
| | | | "autoMappingStrategy" => "None", |
| | | | "traversalStrategy" => "None" |
| | | | ] |
| email | Symfony\Component\Validator\Constraints\Email | Default, DummyClassOne | [ |
| | | | "message" => "This value is not a valid email address.", |
| | | | "mode" => null, |
| | | | "normalizer" => null, |
| | | | "payload" => null |
| | | | ] |
| dummyClassTwo | property options | | [ |
| | | | "cascadeStrategy" => "Cascade", |
| | | | "autoMappingStrategy" => "None", |
| | | | "traversalStrategy" => "Implicit" |
| | | | ] |
+---------------+----------------------------------------------------+------------------------+------------------------------------------------------------+