public function testConstructorWithAuthor()
 {
     $author = Author::robot();
     $parameters = ['author' => $author];
     $mock = $this->getMockForAbstractEvent($parameters);
     $this->assertEquals($author, $mock->author);
 }
 public function testConstructorWithAuthor()
 {
     $requester = Author::robot();
     $parameters = ['requester' => $requester];
     $mock = $this->getMockForAbstractCommand($parameters);
     $this->assertEquals($requester, $mock->requester);
 }
 /**
  * @param array $data The list of properties values. The key represent the property name.
  */
 public function __construct(array $data = [])
 {
     // Enforce the date property to be set.
     // Should not rely on the one given by the user.
     $data['date'] = new DateTime();
     $data['author'] = isset($data['author']) ? $data['author'] : Author::robot();
     $this->populate($data);
 }
Пример #4
0
 public function testRobot()
 {
     $author = Author::robot();
     $this->assertNull($author->identifier);
     $this->assertEquals(Robot::class, $author->type);
 }
 /**
  * @param array $data An array ['propertyName' => 'value', ...]
  */
 public function __construct(array $data = [])
 {
     $data['requester'] = isset($data['requester']) ? $data['requester'] : Author::robot();
     $this->populate($data);
 }