Tests/IndexerTest.php
/**
     * @test
     * @testdox Tests the structure of the query phrase to see if it's looking for a date range.
     */
@test
@testdox Tests the structure of the query phrase to see if it's looking for a date range.
@test @testdox Tests the structure of the query phrase to see if it ' s looking for a date range .
public function isQueryPhraseADateRangeWhenSearchingForExpiredUrls()
    {
        $selectQuery = $this
            ->getMockBuilder('Solarium\QueryType\Select\Query\Query')
            ->setMethods(['setQuery'])
            ->getMock();
        $selectQuery
            ->expects($this->once())
            ->method('setQuery')
            ->with($this->callback(function ($subject) {
                return preg_match('/^revisit_expiration:\[\* TO .*\]$/', $subject);
            }))
            ->will($this->returnValue($selectQuery));
        $solrClient = $this
            ->getMockBuilder('Solarium\Client')
            ->setMethods(['createSelect', 'select'])
            ->getMock();
        $solrClient
            ->expects($this->once())
            ->method('createSelect')
            ->will($this->returnValue($selectQuery));
        $indexer = new Indexer($solrClient, [], 50);
        $indexer->findExpiredUrls('test');
    }
public function isQueryPhraseADateRangeWhenSearchingForExpiredUrls ( ) { $ selectQuery = $ this -> getMockBuilder ( 'Solarium\QueryType\Select\Query\Query' ) -> setMethods ( [ 'setQuery' ] ) -> getMock ( ) ; $ selectQuery -> expects ( $ this -> once ( ) ) -> method ( 'setQuery' ) -> with ( $ this -> callback ( function ( $ subject ) { return preg_match ( '/^revisit_expiration:\[\* TO .*\]$/' , $ subject ) ; } ) ) -> will ( $ this -> returnValue ( $ selectQuery ) ) ; $ solrClient = $ this -> getMockBuilder ( 'Solarium\Client' ) -> setMethods ( [ 'createSelect' , 'select' ] ) -> getMock ( ) ; $ solrClient -> expects ( $ this -> once ( ) ) -> method ( 'createSelect' ) -> will ( $ this -> returnValue ( $ selectQuery ) ) ; $ indexer = new Indexer ( $ solrClient , [ ] , 50 ) ; $ indexer -> findExpiredUrls ( 'test' ) ; }
@test
 @testdox Tests the structure of the query phrase to see if it's looking for a date range.
@test @testdox Tests the structure of the query phrase to see if it ' s looking for a date range .