filesystem->expects(self::once()) ->method('copy') ->with('/source/from', '/target/to'); $this->copier->copy('from', 'to'); $this->copier->doCopy('/source', '/target'); } public function testDoMkdir(): void { $this->filesystem->expects(self::once()) ->method('mkdir') ->with('/target/directory'); $this->copier->mkdir('directory'); $this->copier->doMkdir('/target'); } protected function setUp(): void { $this->filesystem = $this->createMock(Filesystem::class); $this->copier = new Copier($this->filesystem); } }