Sokil\Mongo\ExpressionTest::testCombinedWhereWithLikeAndNotIn PHP Метод

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

    public function testCombinedWhereWithLikeAndNotIn()
    {
        // create new document
        $document = $this->collection->createDocument(array('param' => 'abcd'));
        $document->save();
        $documentId = $document->getId();
        // try to found - must be empty result
        $document = $this->collection->find()->whereLike('param', 'wrongregex[a-z]{2}')->whereNotIn('param', array('abzz'))->findOne();
        $this->assertEmpty($document);
        // try to found - must be empty result
        $document = $this->collection->find()->whereLike('param', 'ab[a-z]{2}')->whereNotIn('param', array('abcd'))->findOne();
        $this->assertEmpty($document);
        // try to found - must be one result
        $document = $this->collection->find()->whereLike('param', 'ab[a-z]{2}')->whereNotIn('param', array('abzz'))->findOne();
        $this->assertEquals($documentId, $document->getId());
    }