/** * 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); }
/** * 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))); }