lithium\tests\cases\data\collection\DocumentSetTest::testMappingToNewDocumentSet PHP Method

testMappingToNewDocumentSet() public method

    public function testMappingToNewDocumentSet()
    {
        $result = new MockResult(array('data' => array(array('_id' => '4c8f86167675abfabdbf0300', 'title' => 'bar'), array('_id' => '5c8f86167675abfabdbf0301', 'title' => 'foo'), array('_id' => '6c8f86167675abfabdbf0302', 'title' => 'dib'))));
        $model = $this->_model;
        $doc = new DocumentSet(compact('model', 'result'));
        $mapped = $doc->map(function ($data) {
            return $data;
        });
        $this->assertEqual($doc->data(), $mapped->data());
        $this->assertEqual($model, $doc->model());
        $this->assertEqual($model, $mapped->model());
    }