public function testProcessRequestReturnsNotFoundIfFileIsNotSynchronized() { $this->sync->expects($this->once())->method('synchronize')->with(self::RELATIVE_FILE_PATH); $this->directoryMock->expects($this->once())->method('getAbsolutePath')->with()->will($this->returnValue(self::MEDIA_DIRECTORY)); $this->directoryMock->expects($this->once())->method('isReadable')->with(self::RELATIVE_FILE_PATH)->will($this->returnValue(false)); $this->responseMock->expects($this->once())->method('setHttpResponseCode')->with(404); $this->assertSame($this->responseMock, $this->model->launch()); }
public function testProcessRequestReturnsNotFoundIfFileIsNotSynchronized() { $this->_requestMock->expects($this->any())->method('getPathInfo')->will($this->returnValue($this->_mediaDirectory . '/')); $this->_sync->expects($this->once())->method('synchronize'); $this->_requestMock->expects($this->any())->method('getFilePath')->will($this->returnValue('non_existing_file_name')); $this->_responseMock->expects($this->once())->method('setHttpResponseCode')->with(404); $this->assertSame($this->_responseMock, $this->_model->launch()); }