Exemple #1
0
 public function testNormalizeNode()
 {
     $nodes = array('Node' => 'Node', 'x5_5' => 'x5_5', 'Bob' => '#Bob', 'Judy' => '12Judy', 'Zip' => '283992(*&(@*@&-Z&^i--##p');
     foreach ($nodes as $expected => $test) {
         $this->assertEquals($expected, Encoder::normalizeNode($test));
     }
     try {
         $x = Encoder::normalizeNode('###');
         $this->assertEquals('Should have an exception', $x);
     } catch (\Exception $e) {
         $this->assertTrue($e instanceof \Imperium\Exception\InvalidInputValue);
         $this->assertEquals('XML node names must not be blank', $e->getMessage());
     }
 }