Mongolid\Cursor\EmbeddedCursorTest::testShouldGetCurrentUsingEntityClass PHP Метод

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

    public function testShouldGetCurrentUsingEntityClass()
    {
        // Arrange
        $object = new stdClass();
        $object->name = 'A';
        $items = [$object];
        $cursor = $this->getCursor(stdClass::class, $items);
        $this->setProtected($cursor, 'position', 0);
        // Assert
        $entity = $cursor->current();
        $this->assertInstanceOf(stdClass::class, $entity);
        $this->assertAttributeEquals('A', 'name', $entity);
    }