Gittern\RepositoryTest::testCanFlushIndex PHP Method

testCanFlushIndex() public method

public testCanFlushIndex ( )
    public function testCanFlushIndex()
    {
        $index = M::mock();
        $rp = new \ReflectionProperty('Gittern\\Repository', 'index');
        $rp->setAccessible(true);
        $rp->setValue($this->repo, $index);
        $desiccator = M::mock();
        $desiccator->shouldReceive('desiccate')->with($index)->andReturn('foo');
        $transport = M::mock('Gittern\\Transport\\TransportInterface');
        $transport->shouldReceive('putIndexData')->with('foo')->once();
        $this->repo->setIndexDesiccator($desiccator);
        $this->repo->setTransport($transport);
        $this->repo->flushIndex();
    }