示例#1
0
 public function testConstructor()
 {
     $subject = 'order-car-123';
     $context = array('color' => 'red');
     $action = new Action(new ActionDefinition('orderPaintForCar', 'Class'), 'orderPaintForCar', $subject, $context);
     $action->setState(Action::STATE_COMPLETED);
     $action->setExecutedAt(new \DateTime("now"));
     $this->assertEquals($action->getDefinition()->getName(), 'orderPaintForCar');
     $this->assertEquals($action->getName(), 'orderPaintForCar');
     $this->assertEquals($action->getContext(), $context);
     $this->assertEquals($action->getSubject(), $subject);
 }