Sokil\Mongo\DocumentValidationTest::testIsValid_FieldBetween PHP Method

testIsValid_FieldBetween() public method

    public function testIsValid_FieldBetween()
    {
        // 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', 'between', 'min' => 6, 'max' => 14))));
        $document->set('some-field-name', 1);
        $this->assertFalse($document->isValid());
        $document->set('some-field-name', 8);
        $this->assertTrue($document->isValid());
        $document->set('some-field-name', 19);
        $this->assertFalse($document->isValid());
    }