Mongolid\Util\SequenceServiceTest::testShouldGetRawCollection PHP Метод

testShouldGetRawCollection() публичный Метод

    public function testShouldGetRawCollection()
    {
        // Arrange
        $connPool = m::mock(Pool::class);
        $sequenceService = new SequenceService($connPool, 'foobar');
        $connection = m::mock(Connection::class);
        $collection = m::mock(Collection::class);
        $connection->defaultDatabase = 'grimory';
        $connection->grimory = (object) ['foobar' => $collection];
        // Act
        $connPool->shouldReceive('getConnection')->once()->andReturn($connection);
        $connection->shouldReceive('getRawConnection')->andReturn($connection);
        // Assertion
        $this->assertEquals($collection, $this->callProtected($sequenceService, 'rawCollection'));
    }