shouldReceive('getCore')->times(2)->andReturn($resource); $command = new GetSizeGd(array()); $result = $command->execute($image); $this->assertTrue($result); $this->assertTrue($command->hasOutput()); $this->assertInstanceOf('Intervention\Image\Size', $command->getOutput()); } public function testImagick() { $imagick = Mockery::mock('Imagick'); $imagick->shouldReceive('identifyimage')->with(true); $image = Mockery::mock('Intervention\Image\Image'); $image->shouldReceive('getCore')->once()->andReturn($imagick); $command = new GetSizeImagick(array()); $result = $command->execute($image); $this->assertTrue($result); $this->assertTrue($command->hasOutput()); $this->assertInstanceOf('Intervention\Image\Size', $command->getOutput()); } }