Beispiel #1
0
 public function testInitialize()
 {
     /** @var MockInterface[] $properties */
     $properties = ['dispatcher' => \Mockery::mock('Symfony\\Component\\EventDispatcher\\EventDispatcher'), 'output' => \Mockery::mock('Bldr\\Output\\BldrOutput'), 'task' => \Mockery::mock('Bldr\\Task\\TaskInterface')];
     $properties['task']->shouldReceive('getProperties')->withNoArgs()->andReturn([]);
     $task = new MockTask();
     $task->configure();
     $task->validate();
     $this->assertInstanceOf('Bldr\\Task\\TaskInterface', $task);
     $this->assertInstanceOf('Bldr\\Block\\Core\\Task\\AbstractTask', $task);
 }
Beispiel #2
0
 public function testConstructor()
 {
     $task = new MockTask();
     $task->configure();
     $task->addParameter('test', false);
     $task->addParameter('required-test', true);
     $task->setParameter('required-test', 'test');
     $task->validate();
     $this->assertInstanceOf('Bldr\\Block\\Core\\Task\\AbstractTask', $task);
     $this->assertInstanceOf('Bldr\\Task\\TaskInterface', $task);
     $this->assertEquals('mock', $task->getName());
     $this->assertEquals('mock description', $task->getDescription());
 }