Skip to content

Commit

Permalink
EZP-28881: Add a field to support "date object was trashed
Browse files Browse the repository at this point in the history
Closes #2379
  • Loading branch information
thiago2509 authored and andrerom committed Sep 17, 2018
1 parent e017b34 commit ae82a7e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Repository/Tests/TrashServiceTest.php
Expand Up @@ -21,6 +21,7 @@
use eZ\Publish\API\Repository\Values\Content\TrashItem as APITrashItem;
use eZ\Publish\Core\Repository\Values\Content\TrashItem;
use eZ\Publish\Core\Repository\Values\Content\Location;
use DateTime;

/**
* Test case for operations in the TrashService using in memory storage.
Expand Down Expand Up @@ -257,6 +258,21 @@ public function testLoadTrashItem()
$trashItemReloaded
);

$this->assertInstanceOf(
DateTime::class,
$trashItemReloaded->trashed
);

$this->assertEquals(
$trashItem->trashed->getTimestamp(),
$trashItemReloaded->trashed->getTimestamp()
);

$this->assertGreaterThan(
0,
$trashItemReloaded->trashed->getTimestamp()
);

$this->assertInstanceOf(
Content::class,
$content = $trashItemReloaded->getContent()
Expand Down
6 changes: 6 additions & 0 deletions Repository/Values/Content/TrashItem.php
Expand Up @@ -13,4 +13,10 @@
*/
abstract class TrashItem extends Location
{
/**
* Trashed timestamp.
*
* @var \DateTime
*/
protected $trashed;
}

0 comments on commit ae82a7e

Please sign in to comment.