/** * @param \_OurBrand_\Quiz\Domain\Model\Exercises\MatchPictureInPictureExercise $exercise * @return void */ private function editAssignment($exercise) { $exercise->setMediaContent('picture', false); // remove the standard add picture link in the top of the exercise $this->view->assign('mainImage', $exercise->getMainImage()); $this->view->assign('existingShapes', $exercise->getShapesAsJson()); $this->view->assign('currentExercise', $exercise); $this->view->assign('quiz', $exercise->getQuiz()); }
public function testMainImage() { $exercise = new MatchPictureInPictureExercise(); $mockMainImage = $this->getMock('_OurBrand_\\Quiz\\Domain\\Model\\Exercises\\MatchPictureInPictureMainImage'); $mockMainImage->expects($this->any())->method('getX')->will($this->returnValue(666)); $collection = new \Doctrine\Common\Collections\ArrayCollection(); $collection->add($mockMainImage); $this->assertNull($exercise->setMainImageCollection($collection), 'setMainImageCollection() must return null'); $this->assertCount(1, $exercise->getMainImageCollection(), 'getMainImageCollection() count doesn\'t match'); $this->assertSame(true, is_object($exercise->getMainImage()), 'getMainImage() must return an object of \\_OurBrand_\\Quiz\\Domain\\Model\\Exercises\\MatchPictureInPictureMainImage'); $mockImage = $this->getMock('\\_OurBrand_\\Quiz\\Domain\\Model\\ImageResource'); $this->assertNull($exercise->addMainImage($mockImage), 'addMainImage() must have an imageResource object given'); }