eZ\Bundle\EzPublishCoreBundle\Tests\Imagine\Filter\Loader\BorderFilterLoaderTest::testLoadDefaultColor PHP Method

testLoadDefaultColor() public method

    public function testLoadDefaultColor()
    {
        $image = $this->getMock('\\Imagine\\Image\\ImageInterface');
        $options = array(10, 10);
        $palette = $this->getMock('\\Imagine\\Image\\Palette\\PaletteInterface');
        $image->expects($this->once())->method('palette')->will($this->returnValue($palette));
        $palette->expects($this->once())->method('color')->with(BorderFilterLoader::DEFAULT_BORDER_COLOR)->will($this->returnValue($this->getMock('\\Imagine\\Image\\Palette\\Color\\ColorInterface')));
        $box = $this->getMock('\\Imagine\\Image\\BoxInterface');
        $image->expects($this->once())->method('getSize')->will($this->returnValue($box));
        $box->expects($this->any())->method('getWidth')->will($this->returnValue(100));
        $box->expects($this->any())->method('getHeight')->will($this->returnValue(100));
        $drawer = $this->getMock('\\Imagine\\Draw\\DrawerInterface');
        $image->expects($this->once())->method('draw')->will($this->returnValue($drawer));
        $drawer->expects($this->any())->method('line')->will($this->returnValue($drawer));
        $loader = new BorderFilterLoader();
        $this->assertSame($image, $loader->load($image, $options));
    }