public function testMoveWithFuncMock() { $container = new \MicroVFS\Container(); $container->set('tmp/xxxxx.tmp', 'test text'); $container->setDir('target'); \MicroVFS\StreamWrapper::unregister('vfs'); \MicroVFS\StreamWrapper::register('vfs', $container); $defunc = (new \Defunc\Builder())->in('Yen\\Http'); $defunc->move_uploaded_file('vfs://tmp/xxxxx.tmp', 'vfs://target/test.txt')->willReturn(true); $ufile = new Http\UploadedFile(UPLOAD_ERR_OK, 9, 'test.txt', 'text/plain', 'vfs://tmp/xxxxx.tmp'); $moved = $ufile->moveTo('vfs://target/test.txt'); $this->assertTrue($moved); $defunc->clear(); }