Sokil\Mongo\ExpressionTest::testFileType PHP Method

testFileType() public method

public testFileType ( )
    public function testFileType()
    {
        // create new document
        $document = $this->collection->createDocument(array('f_double' => 1.1, 'f_string' => 'string', 'f_object' => array('key' => 'value'), 'f_array' => array(1, 2, 3), 'f_array_of_array' => array(array(1, 2), array(3, 4)), 'f_objectId' => new \MongoId(), 'f_boolean' => false, 'f_date' => new \MongoDate(), 'f_null' => null));
        $document->save();
        $this->assertNotEmpty($this->collection->find()->whereDouble('f_double')->findOne());
        $this->assertNotEmpty($this->collection->find()->whereString('f_string')->findOne());
        $this->assertNotEmpty($this->collection->find()->whereObject('f_object')->findOne());
        $this->assertNotEmpty($this->collection->find()->whereArray('f_array')->findOne());
        $this->assertNotEmpty($this->collection->find()->whereArrayOfArrays('f_array_of_array')->findOne());
        $this->assertNotEmpty($this->collection->find()->whereObjectId('f_objectId')->findOne());
        $this->assertNotEmpty($this->collection->find()->whereBoolean('f_boolean')->findOne());
        $this->assertNotEmpty($this->collection->find()->whereDate('f_date')->findOne());
        $this->assertNotEmpty($this->collection->find()->whereNull('f_null')->findOne());
    }