コード例 #1
0
 public function testConstructorWithAuthor()
 {
     $author = Author::robot();
     $parameters = ['author' => $author];
     $mock = $this->getMockForAbstractEvent($parameters);
     $this->assertEquals($author, $mock->author);
 }
コード例 #2
0
 public function testConstructorWithAuthor()
 {
     $requester = Author::robot();
     $parameters = ['requester' => $requester];
     $mock = $this->getMockForAbstractCommand($parameters);
     $this->assertEquals($requester, $mock->requester);
 }
コード例 #3
0
 /**
  * @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);
 }
コード例 #5
0
 /**
  * @param array $data An array ['propertyName' => 'value', ...]
  */
 public function __construct(array $data = [])
 {
     $data['requester'] = isset($data['requester']) ? $data['requester'] : Author::robot();
     $this->populate($data);
 }