setValue() public method

public setValue ( mixed $value )
$value mixed
Esempio n. 1
0
 /**
  * Test if variable value equals expected value
  *
  * @dataProvider variableProvider
  */
 public function testGetValue($actual, $expected)
 {
     $var = new Variable('foo', 'bar', false, false, new Location(1, 1));
     $var->setValue($actual);
     $this->assertEquals($var->getValue(), $expected);
 }
Esempio n. 2
0
 public function testVariable()
 {
     $variable = new Variable('id', 'int', false, false, new Location(1, 1));
     $this->assertEquals('id', $variable->getName());
     $this->assertEquals('int', $variable->getTypeName());
     $this->assertFalse($variable->isNullable());
     $this->assertFalse($variable->isArray());
     $variable->setTypeName('string');
     $this->assertEquals('string', $variable->getTypeName());
     $variable->setName('limit');
     $this->assertEquals('limit', $variable->getName());
     $variable->setIsArray(true);
     $variable->setNullable(true);
     $this->assertTrue($variable->isNullable());
     $this->assertTrue($variable->isArray());
     $variable->setValue(new Literal('text', new Location(1, 1)));
     $this->assertEquals(new Literal('text', new Location(1, 1)), $variable->getValue());
 }