/** * Add a new TrackedObject into map * @param TrackedObject $tracked */ public function add(TrackedObject $tracked) { $id = $tracked->getID(); if (isset($this->map[$id])) { return; } $this->map[$id] = $tracked; $this->adapter->watch($tracked); }
function its_checkPath_should_track_on_filesystem_create_event(AdapterInterface $adapter, Listener $listener) { $newFile = MFS::$tmpDir . '/new.txt'; $listener->hasPath($newFile)->shouldBeCalled()->willReturn(true); $adapter->watch(Argument::any())->shouldBeCalled(); $this->beConstructedWith($adapter); $this->initialize($listener); touch($newFile); $this->checkPath($newFile); $this->getChangeSet()->shouldHaveCount(1); }