public function testIsValid_RequiredField()
{
// 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', 'required'))));
// required field empty
$this->assertFalse($document->isValid());
// required field set
$document->set('some-field-name', 'some-value');
$this->assertTrue($document->isValid());
}