public function testDefaultValue() { $module = $this->newModule(); $student = $this->newStudent(); $module->save(); $student->save(); $this->given($this->newTestedInstance())->if($this->testedInstance->module_id = $module->getId())->if($this->testedInstance->user_id = $student->getId())->then->boolean($this->testedInstance->save())->isTrue()->boolean($this->testedInstance->hasChanges())->isFalse()->given($dbTestedInstCopy = \website\model\StudentModuleSubscription::findOneWhere(['module_id' => $this->testedInstance->getModuleId(), 'user_id' => $this->testedInstance->getUserId()]))->then->object($dbTestedInstCopy)->isEqualTo($this->testedInstance); }