function let(FileFactory $factory, Adapter $adapter, CanLoad $operator, File $file, File $other) { $factory->create('key')->willReturn($file); $file->getName()->willReturn('key'); $file->setContent(Argument::any())->willReturn($file); $file->getContent()->willReturn('file-content'); $adapter->exists('key')->willReturn(true); $operator->implement('Gaufrette\\Core\\Operator\\CanSave'); $operator->supports($file, $adapter)->willReturn(true); $operator->load($file, $adapter)->willReturn('adapter-content'); $this->beConstructedWith($adapter, $factory); $this->addOperator($operator); }