Skip to content

Commit

Permalink
#6174 #5570 removed modifications applied to the `CompanyContractList…
Browse files Browse the repository at this point in the history
…ener`, since `UnitOfWorkTest` now completely encapsulates the scenarios being covered
  • Loading branch information
Ocramius committed Dec 18, 2016
1 parent cfd595b commit 21a5d8c
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions tests/Doctrine/Tests/Models/Company/CompanyContractListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

class CompanyContractListener
{
const PRE_PERSIST = 0;

public $postPersistCalls;
public $prePersistCalls;

Expand All @@ -19,8 +17,6 @@ class CompanyContractListener

public $postLoadCalls;

public $snapshots = [];

/**
* @PostPersist
*/
Expand All @@ -34,7 +30,6 @@ public function postPersistHandler(CompanyContract $contract)
*/
public function prePersistHandler(CompanyContract $contract)
{
$this->snapshots[self::PRE_PERSIST][] = $this->takeSnapshot($contract);
$this->prePersistCalls[] = func_get_args();
}

Expand Down Expand Up @@ -85,23 +80,4 @@ public function postLoadHandler(CompanyContract $contract)
{
$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;
}
}

0 comments on commit 21a5d8c

Please sign in to comment.