Contao\CoreBundle\Test\Contao\ImageTest::testConstructWithNonexistentFile PHP Method

testConstructWithNonexistentFile() public method

Tests the object instantiation with a non-existent file.
    public function testConstructWithNonexistentFile()
    {
        /** @var File|\PHPUnit_Framework_MockObject_MockObject $fileMock */
        $fileMock = $this->getMockBuilder('Contao\\File')->setMethods(['__get', 'exists'])->setConstructorArgs(['dummy.jpg'])->getMock();
        $fileMock->expects($this->any())->method('exists')->will($this->returnValue(false));
        new Image($fileMock);
    }