/** * @group current */ public function testFooBar() { $listener = new TestedListener(); $listener->to($dir = self::$tmpDir); $listener->setAdapter($this->getAdapter()); touch($file = $dir . '/foobar.txt'); $listener->start(); }
public function testShouldNotTrackIgnoredDir() { $dir = self::$tmpDir; $this->mkdir($foo = $dir . '/foo'); $this->mkdir($fooBar = $dir . '/foo/bar'); $this->mkdir($hello = $dir . '/hello'); $this->mkdir($helloWorld = $dir . '/hello/world'); $listener1 = new TestedListener($dir); $listener1->ignores('#foo/bar.*$#'); $listener1->setAdapter($this->getAdapter()); touch($f1 = $foo . '/foo.txt'); touch($f2 = $fooBar . '/bar.txt'); touch($f3 = $hello . '/hello.txt'); touch($f4 = $helloWorld . '/world.txt'); $listener1->start(); $changeSet = $listener1->getChangeSet(); $this->assertCount(3, $changeSet); $this->assertEventHasResource($f1, FilesystemEvent::CREATE, $changeSet); $this->assertEventHasResource($f3, FilesystemEvent::CREATE, $changeSet); $this->assertEventHasResource($f4, FilesystemEvent::CREATE, $changeSet); }