Skip to content

Commit

Permalink
ensure MailboxHandler does result in modified timestamp being updated…
Browse files Browse the repository at this point in the history
…, and they are both set on insertion - see #469
  • Loading branch information
DavidGoodwin committed Apr 5, 2021
1 parent 60ff94e commit 3ad0591
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/MailboxHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public function testAddingDataEtc() {
$x->save();

$x->getList('');

$list = $x->result();

$this->assertEquals(1, count($list), json_encode($x->errormsg));
Expand All @@ -128,13 +127,20 @@ public function testAddingDataEtc() {
$this->assertEquals('example.com', $details['domain']);
$this->assertEquals('david.test@example.com', $details['username']);
$this->assertEquals('test person', $details['name']);

$this->assertNotEmpty($details['_modified']);
$this->assertNotEmpty($details['_created']);

$this->assertEquals($details['_modified'], $details['_created']); // new data should have them equal.
$found = true;
break;
}
}

$this->assertTrue($found, "check output : " . json_encode($list));

// need to make updated != created.
sleep(1);

// Try and edit.

Expand All @@ -151,7 +157,7 @@ public function testAddingDataEtc() {
'username' => 'david.test@example.com'
]);

$this->assertEmpty($h->errormsg, json_Encode($h->errormsg));
$this->assertEmpty($h->errormsg, json_encode($h->errormsg));
$this->assertEmpty($h->infomsg);
$this->assertTrue($r);
$this->assertTrue($h->save());
Expand All @@ -167,6 +173,9 @@ public function testAddingDataEtc() {
$this->assertEquals('david.test@example.com', $details['username']);
$this->assertEquals(123456, $details['quota']);
$this->assertEquals('test person 1234', $details['name']);

$this->assertNotEquals($details['_modified'], $details['_created']);

$found = true;
break;
}
Expand Down

0 comments on commit 3ad0591

Please sign in to comment.