public function remove(TrackedObject $tracked) { $path = (string) $tracked->getResource(); if (in_array($path, $this->listener->getPaths())) { return; } unset($this->map[$tracked->getID()]); $this->adapter->unwatch($tracked); }
function its_checkPath_should_track_on_filesystem_delete_event(AdapterInterface $adapter, FileResource $resource, TrackedObject $tracked) { $tracked->getResource()->shouldBeCalled()->willReturn($resource); $tracked->getChecksum()->shouldBeCalled()->willReturn('checksum'); $resource->isExists()->shouldBeCalled()->willReturn(false); $resource->getChecksum()->willReturn('new_checksum')->shouldBeCalled(); $resource->getResource()->willReturn($this->testFile); $adapter->unwatch($tracked)->shouldBeCalled(); $this->checkPath($this->testFile); $this->getChangeSet()->shouldHaveCount(1); }