예제 #1
0
 public function setUp()
 {
     $maxlevel = 8;
     $factoryTypeMock = m::mock('Ladybug\\Type\\FactoryType');
     $factoryTypeMock->shouldReceive('factory')->with(m::anyOf(1, 2, 3), m::any())->andReturnUsing(function ($var, $level) {
         $intType = new Type\Int();
         $intType->load($var, $level);
         return $intType;
     });
     $this->type = new Type\Vector\Container($maxlevel, $factoryTypeMock);
 }
예제 #2
0
 public function setUp()
 {
     $maxlevel = 8;
     $factoryTypeMock = m::mock('Ladybug\\Type\\FactoryType');
     $factoryTypeMock->shouldReceive('factory')->with(m::anyOf(1, 2, 3, 4), m::any())->andReturnUsing(function ($var, $level) {
         $intType = new Type\Int();
         $intType->load($var, $level);
         return $intType;
     });
     $managerInspectorMock = m::mock('Ladybug\\Inspector\\InspectorManager');
     $managerInspectorMock->shouldReceive('get')->andReturn(null);
     $metadataResolverMock = m::mock('Ladybug\\Metadata\\MetadataResolver');
     $metadataResolverMock->shouldReceive('has')->andReturn(false);
     $this->type = new Type\Object\Container($maxlevel, $factoryTypeMock, $managerInspectorMock, $metadataResolverMock);
 }
예제 #3
0
 public function testLoaderForOtherType()
 {
     $this->setExpectedException('Ladybug\\Type\\Exception\\InvalidVariableTypeException');
     $var = 'test';
     $this->type->load($var);
 }