示例#1
0
 /**
  * Tests the setValue() method.
  * @covers \ManiaScript\Builder\Directive\Constant::setValue
  */
 public function testSetValue()
 {
     $expected = 'abc';
     $directive = new Constant();
     $result = $directive->setValue($expected);
     $this->assertPropertyEquals($expected, $directive, 'value');
     $this->assertEquals($directive, $result);
 }
示例#2
0
 /**
  * Data provider for the addDirective test.
  * @return array The data.
  */
 public function providerAddDirective()
 {
     $directive1 = new Setting();
     $directive1->setValue('def')->setName('abc');
     $directive2 = new Constant();
     $directive2->setValue('ghi')->setName('def');
     $directive3 = new Library();
     $directive3->setLibrary('jkl')->setName('abc');
     return array(array(array($directive1->getName() => $directive1), $directive1, array()), array(array($directive1->getName() => $directive1, $directive2->getName() => $directive2), $directive2, array($directive1->getName() => $directive1)), array(array($directive3->getName() => $directive3), $directive3, array($directive1->getName() => $directive1)));
 }