Ejemplo n.º 1
0
 /**
  * Tests the setLibrary() method.
  * @covers \ManiaScript\Builder\Directive\Library::setLibrary
  */
 public function testSetLibrary()
 {
     $expected = 'abc';
     $directive = new Library();
     $result = $directive->setLibrary($expected);
     $this->assertEquals($directive, $result);
     $this->assertPropertyEquals($expected, $directive, 'library');
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 3
0
 /**
  * Adds a #Include directive to the ManiaScript.
  * @param string $libraryName The name of the library.
  * @param string $alias The alias to be used.
  * @return $this Implementing fluent interface.
  */
 public function addLibrary($libraryName, $alias = '')
 {
     $library = new Library();
     $library->setLibrary($libraryName)->setAlias($alias);
     $this->builder->addDirective($library);
     return $this;
 }