コード例 #1
0
ファイル: ContainerTest.php プロジェクト: jeyram/camp-gdl
 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
ファイル: ContainerTest.php プロジェクト: jeyram/camp-gdl
 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
ファイル: IntTypeTest.php プロジェクト: ankalagon/ladybug
 public function testLoaderForOtherType()
 {
     $this->setExpectedException('Ladybug\\Type\\Exception\\InvalidVariableTypeException');
     $var = 'test';
     $this->type->load($var);
 }