1bf884970f
Which is needed to test void methods that shouldn't raise any exception on a certain condition. If the interpreter gets to the point where the assertion count is incremented it means that no exceptions have been thrown and our test is successful. Important to note that some tests were slighly refactored to simplify things a bit.
53 lines
942 B
PHP
53 lines
942 B
PHP
<?php
|
|
|
|
namespace Doctrine\Tests\ORM\Functional\Ticket;
|
|
|
|
class DDC588Test extends \Doctrine\Tests\OrmFunctionalTestCase
|
|
{
|
|
protected function setUp()
|
|
{
|
|
parent::setUp();
|
|
|
|
$this->_schemaTool->createSchema(
|
|
[
|
|
$this->_em->getClassMetadata(DDC588Site::class),
|
|
]
|
|
);
|
|
}
|
|
|
|
public function testIssue()
|
|
{
|
|
$site = new DDC588Site('Foo');
|
|
|
|
$this->_em->persist($site);
|
|
$this->_em->flush();
|
|
// Following should not result in exception
|
|
$this->_em->refresh($site);
|
|
|
|
$this->addToAssertionCount(1);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @Entity
|
|
*/
|
|
class DDC588Site
|
|
{
|
|
/**
|
|
* @Id
|
|
* @Column(type="integer", name="site_id")
|
|
* @GeneratedValue
|
|
*/
|
|
public $id;
|
|
|
|
/**
|
|
* @Column(type="string", length=45)
|
|
*/
|
|
protected $name = null;
|
|
|
|
public function __construct($name = '')
|
|
{
|
|
$this->name = $name;
|
|
}
|
|
}
|