Esempio n. 1
0
 public function testBuildCache()
 {
     $finder = new Finder();
     $finder->registerReader(new RawContentReader());
     $cache = $this->getMockBuilder(ArrayAdapter::class)->setMethods(['saveDeferred'])->getMock();
     $finder->registerCache($cache);
     $cache->expects($this->exactly(3))->method('saveDeferred');
     $finder->createQuery()->useLanguage(new French())->searchFor('test')->inDirectory($this->getInvoiceDirectory())->buildCache();
 }
Esempio n. 2
0
 public function testDateQuery()
 {
     $finder = new Finder();
     $finder->registerReader(new RawContentReader());
     $results = $finder->createQuery()->useLanguage(new French())->searchFor('newlane')->submittedOn(new \DateTime('2016-08-20'))->inDirectory($this->getInvoiceDirectory())->getResults();
     $this->assertCount(4, $results);
     $this->assertEquals('1.txt', $results[0]['invoice']->getName());
     $this->assertEquals('0.txt', $results[1]['invoice']->getName());
 }