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\IntType(); $intType->load($var, $level); return $intType; }); $this->type = new Type\ArrayType($maxlevel, $factoryTypeMock); }
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\IntType(); $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\ObjectType($maxlevel, $factoryTypeMock, $managerInspectorMock, $metadataResolverMock); }