public function testDumperDoesNotCrashOnWrongTypeHints()
 {
     $var = new FlawedClass();
     $this->type->load($var);
     // class info
     $this->assertEquals('Ladybug\\Tests\\Type\\Object\\FlawedClass', $this->type->getClassName());
     $this->assertEquals(__FILE__, $this->type->getClassFile());
     $this->assertCount(2, $this->type->getClassMethods());
     $privateMethod = $this->type->getMethodByName('privateMethod');
     $this->assertCount(2, $privateMethod->getParameters());
     $parameter1 = $privateMethod->getParameterByName('bar');
     $this->assertNull($parameter1->getType());
     $this->assertFalse($parameter1->isReference());
     $badTypeHinted = $privateMethod->getParameterByName('baz');
     $this->assertEquals('[Undefined Type Hint]', $badTypeHinted->getType());
     $this->assertFalse($badTypeHinted->isReference());
     $this->assertInstanceOf('Ladybug\\Type\\Null', $badTypeHinted->getDefaultValue());
 }
Exemplo n.º 2
0
 public function testLoaderForOtherType()
 {
     $this->setExpectedException('Ladybug\\Type\\Exception\\InvalidVariableTypeException');
     $var = 'test';
     $this->type->load($var);
 }