simplified code
This commit is contained in:
parent
3b4a8f3730
commit
26c54c700b
@ -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';
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user