Sokil\Mongo\DocumentValidationTest::testIsValid_FieldLess PHP Method

testIsValid_FieldLess() public method

    public function testIsValid_FieldLess()
    {
        // mock of document
        $document = $this->getMock('\\Sokil\\Mongo\\Document', array('rules'), array($this->collection));
        $document->expects($this->any())->method('rules')->will($this->returnValue(array(array('some-field-name', 'less', 'than' => 6))));
        $document->set('some-field-name', 1);
        $this->assertTrue($document->isValid());
        $document->set('some-field-name', 6);
        $this->assertFalse($document->isValid());
        $document->set('some-field-name', 9);
        $this->assertFalse($document->isValid());
    }