CRUDlexTests\MySQLDataTest::testUpdateFiles PHP Method

testUpdateFiles() public method

public testUpdateFiles ( )
    public function testUpdateFiles()
    {
        $entityLibrary = $this->dataLibrary->createEmpty();
        $entityLibrary->set('name', 'lib');
        $this->dataLibrary->create($entityLibrary);
        $entityBook = $this->dataBook->createEmpty();
        $entityBook->set('title', 'title');
        $entityBook->set('author', 'author');
        $entityBook->set('pages', 111);
        $entityBook->set('library', $entityLibrary->get('id'));
        $this->dataBook->create($entityBook);
        $request = new Request([], ['title' => 'title', 'author' => 'author', 'pages' => 111, 'library' => $entityLibrary->get('id')], [], [], ['cover' => new UploadedFile(__DIR__ . '/../test1.xml', 'test1.xml')]);
        $fileProcessorHandle = TestDBSetup::getFileProcessorHandle();
        $this->dataBook->updateFiles($request, $entityBook, 'book');
        $fileProcessorHandle->createFile->never()->called();
        $fileProcessorHandle->updateFile->once()->called();
        $fileProcessorHandle->deleteFile->never()->called();
        $fileProcessorHandle->renderFile->never()->called();
    }