simplified code

This commit is contained in:
Fabien Potencier 2017-03-02 10:25:18 -08:00
parent 3b4a8f3730
commit 26c54c700b
2 changed files with 10 additions and 31 deletions

View File

@ -129,9 +129,9 @@ class DoctrineDataCollectorTest extends TestCase
array(fopen(__FILE__, 'r'), array(), 'Resource(stream)', false),
array(new \stdClass(), array(), 'Object(stdClass)', false),
array(
new StringRepresentableClass('presentation test'),
new StringRepresentableClass(),
array(),
'Object(Symfony\Bridge\Doctrine\Tests\DataCollector\StringRepresentableClass): "presentation test"',
'Object(Symfony\Bridge\Doctrine\Tests\DataCollector\StringRepresentableClass): "string representation"',
false,
),
);
@ -168,3 +168,11 @@ class DoctrineDataCollectorTest extends TestCase
return $collector;
}
}
class StringRepresentableClass
{
public function __toString()
{
return 'string representation';
}
}

View File

@ -1,29 +0,0 @@
<?php
namespace Symfony\Bridge\Doctrine\Tests\DataCollector;
/**
* A class for testing __toString method behaviour. It's __toString returns a value, that was passed into constructor.
*/
class StringRepresentableClass
{
/**
* @var string
*/
private $representation;
/**
* CustomStringableClass constructor.
*
* @param string $representation
*/
public function __construct($representation)
{
$this->representation = $representation;
}
public function __toString()
{
return $this->representation;
}
}