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

testInitialCasting() public method

public testInitialCasting ( )
    public function testInitialCasting()
    {
        $model = $this->_model;
        $schema = new DocumentSchema(array('fields' => array('_id' => array('type' => 'id'), 'foo' => array('type' => 'object'), 'foo.bar' => array('type' => 'int')), 'types' => array('int' => 'integer'), 'handlers' => array('integer' => function ($v) {
            return (int) $v;
        })));
        $array = new DocumentSet(compact('model', 'schema') + array('pathKey' => 'foo.bar', 'data' => array('5', '6', '7')));
        foreach ($array as $value) {
            $this->assertInternalType('int', $value);
        }
    }