mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-31 20:20:15 +02:00
Replaced with strict assertions
This commit is contained in:
@@ -15,18 +15,18 @@ class MementoTest extends TestCase
|
||||
// open the ticket
|
||||
$ticket->open();
|
||||
$openedState = $ticket->getState();
|
||||
$this->assertEquals(State::STATE_OPENED, (string) $ticket->getState());
|
||||
$this->assertSame(State::STATE_OPENED, (string) $ticket->getState());
|
||||
|
||||
$memento = $ticket->saveToMemento();
|
||||
|
||||
// assign the ticket
|
||||
$ticket->assign();
|
||||
$this->assertEquals(State::STATE_ASSIGNED, (string) $ticket->getState());
|
||||
$this->assertSame(State::STATE_ASSIGNED, (string) $ticket->getState());
|
||||
|
||||
// now restore to the opened state, but verify that the state object has been cloned for the memento
|
||||
$ticket->restoreFromMemento($memento);
|
||||
|
||||
$this->assertEquals(State::STATE_OPENED, (string) $ticket->getState());
|
||||
$this->assertSame(State::STATE_OPENED, (string) $ticket->getState());
|
||||
$this->assertNotSame($openedState, $ticket->getState());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user