public function testToString() { $admin = new PostAdmin('sonata.post.admin.post', 'NewsBundle\\Entity\\Post', 'SonataNewsBundle:PostAdmin'); $s = new \stdClass(); $this->assertNotEmpty($admin->toString($s)); $s = new FooToString(); $this->assertSame('salut', $admin->toString($s)); // To string method is implemented, but returns null $s = new FooToStringNull(); $this->assertNotEmpty($admin->toString($s)); $this->assertSame('', $admin->toString(false)); }