Example #1
0
 /**
  * Builds the ManiaScript code.
  * @return $this Implementing fluent interface.
  */
 public function build()
 {
     $this->prepareHandlers();
     $this->renderedCode = new RenderedCode();
     $this->renderedCode->setDirectives($this->buildDirectives())->setGlobalCode($this->buildGlobalCode())->setMainFunction($this->buildMainFunction());
     return $this;
 }
 /**
  * Tests the setDirectives() method.
  * @covers \ManiaScript\Builder\RenderedCode::setDirectives
  */
 public function testSetDirectives()
 {
     $expected = 'abc';
     $renderedCode = new RenderedCode();
     $result = $renderedCode->setDirectives($expected);
     $this->assertEquals($renderedCode, $result);
     $this->assertPropertyEquals($expected, $renderedCode, 'directives');
 }