parameters = new Parameters(); $this->onParametersChange = new OnParametersChange(); } /** * @see OnParametersChange::onAdvancedEducationNotationType() */ public function testOnAdvancedEducationNotationTypeByTeachers(){ $educationNotationConfig = new EducationNotationConfig(); $educationCurriculum = new EducationCurriculum(); $educationNotationConfig->addEducationCurriculum($educationCurriculum); $organization = new Organization(); $organization->addEducationNotationConfig($educationNotationConfig); $this->parameters->setAdvancedEducationNotationType(AdvancedEducationNotationTypeEnum::BY_TEACHER()->getValue()); $this->parameters->setOrganization($organization); $this->assertCount(1, $educationNotationConfig->getEducationCurriculums()); $this->onParametersChange->onAdvancedEducationNotationType($this->parameters); $this->assertNull($educationNotationConfig->getEducationCurriculums()->first()->getEducationNotationConfig()); } /** * @see OnParametersChange::onAdvancedEducationNotationType() */ public function testOnAdvancedEducationNotationTypeByEducation(){ $educationNotationConfig = new EducationNotationConfig(); $teacher = new Access(); $educationNotationConfig->addTeacher($teacher); $organization = new Organization(); $organization->addEducationNotationConfig($educationNotationConfig); $this->parameters->setAdvancedEducationNotationType(AdvancedEducationNotationTypeEnum::BY_EDUCATION()->getValue()); $this->parameters->setOrganization($organization); $this->assertCount(1, $educationNotationConfig->getTeachers()); $this->onParametersChange->onAdvancedEducationNotationType($this->parameters); $this->assertNull($educationNotationConfig->getTeachers()->first()->getEducationNotationConfig()); } }