#6174 #5570 removed modifications applied to the CompanyContractListener
, since UnitOfWorkTest
now completely encapsulates the scenarios being covered
This commit is contained in:
parent
3645a9c44d
commit
b0ede40f47
@ -4,8 +4,6 @@ namespace Doctrine\Tests\Models\Company;
|
||||
|
||||
class CompanyContractListener
|
||||
{
|
||||
const PRE_PERSIST = 0;
|
||||
|
||||
public $postPersistCalls;
|
||||
public $prePersistCalls;
|
||||
|
||||
@ -19,8 +17,6 @@ class CompanyContractListener
|
||||
|
||||
public $postLoadCalls;
|
||||
|
||||
public $snapshots = [];
|
||||
|
||||
/**
|
||||
* @PostPersist
|
||||
*/
|
||||
@ -34,7 +30,6 @@ class CompanyContractListener
|
||||
*/
|
||||
public function prePersistHandler(CompanyContract $contract)
|
||||
{
|
||||
$this->snapshots[self::PRE_PERSIST][] = $this->takeSnapshot($contract);
|
||||
$this->prePersistCalls[] = func_get_args();
|
||||
}
|
||||
|
||||
@ -85,23 +80,4 @@ class CompanyContractListener
|
||||
{
|
||||
$this->postLoadCalls[] = func_get_args();
|
||||
}
|
||||
|
||||
public function takeSnapshot(CompanyContract $contract)
|
||||
{
|
||||
$snapshot = [];
|
||||
|
||||
foreach ((new \ReflectionClass($contract))->getProperties() as $property) {
|
||||
$property->setAccessible(true);
|
||||
|
||||
$value = $property->getValue($contract);
|
||||
|
||||
if (is_object($value) || is_array($value)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$snapshot[$property->getName()] = $property->getValue($contract);
|
||||
}
|
||||
|
||||
return $snapshot;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user