SimplePropertySerializerTest.php 851 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace League\Tactician\Logger\Tests\PropertyNormalizer;
  3. use League\Tactician\Logger\PropertyNormalizer\SimplePropertyNormalizer;
  4. use League\Tactician\Logger\Tests\Fixtures\RegisterUserCommand;
  5. class SimplePropertyNormalizerTest extends \PHPUnit_Framework_TestCase
  6. {
  7. /**
  8. * @var SimplePropertyNormalizer
  9. */
  10. private $normalizer;
  11. protected function setUp()
  12. {
  13. $this->normalizer = new SimplePropertyNormalizer();
  14. }
  15. public function testCommandPropertiesCanBeDumpedToString()
  16. {
  17. $this->assertEquals(
  18. ["name" => "Alice", "emailAddress" => "alice@example.org", "age" => 30.5, "createdAt" => "object(DateTime)",
  19. "file" => "resource(stream)", "empty" => null, "options" => "*array*"],
  20. $this->normalizer->normalize(new RegisterUserCommand())
  21. );
  22. }
  23. }