Example #1
0
 /** @test */
 public function itShouldConvertToPhpValues()
 {
     $xml = new SimpleXMLElement('<node>12</node>');
     $this->assertTrue(is_int($xml->phpValue()));
     $xml = new SimpleXMLElement('<node>12.1</node>');
     $this->assertTrue(is_float($xml->phpValue()));
     $xml = new SimpleXMLElement('<node>0xff0000</node>');
     $this->assertTrue(is_int($xml->phpValue()));
     $xml = new SimpleXMLElement('<node>0xNaN</node>');
     $this->assertTrue(is_string($xml->phpValue()));
     $xml = new SimpleXMLElement('<node>true</node>');
     $this->assertTrue($xml->phpValue());
     $xml = new SimpleXMLElement('<node>false</node>');
     $this->assertFalse($xml->phpValue());
 }