diff --git a/Classes/Controller/TestimonialController.php b/Classes/Controller/TestimonialController.php index ba4ef96..eb3d2e4 100644 --- a/Classes/Controller/TestimonialController.php +++ b/Classes/Controller/TestimonialController.php @@ -14,6 +14,7 @@ namespace OliverKlee\Tea\Controller; * The TYPO3 project - inspiring people to share! */ +use OliverKlee\Tea\Domain\Repository\TestimonialRepository; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; /** @@ -24,11 +25,20 @@ use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; class TestimonialController extends ActionController { /** - * @inject * @var \OliverKlee\Tea\Domain\Repository\TestimonialRepository */ protected $testimonialRepository = null; + /** + * @param TestimonialRepository $repository + * + * @return void + */ + public function injectTestimonialRepository(TestimonialRepository $repository) + { + $this->testimonialRepository = $repository; + } + /** * Lists all testimonials. * diff --git a/Tests/Unit/Controller/TestimonialControllerTest.php b/Tests/Unit/Controller/TestimonialControllerTest.php index 52a1609..92d9b27 100644 --- a/Tests/Unit/Controller/TestimonialControllerTest.php +++ b/Tests/Unit/Controller/TestimonialControllerTest.php @@ -70,7 +70,7 @@ class TestimonialControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase $this->testimonialRepositoryProphecy = $this->prophesize(TestimonialRepository::class); $this->testimonialRepository = $this->testimonialRepositoryProphecy->reveal(); - $this->inject($this->subject, 'testimonialRepository', $this->testimonialRepository); + $this->subject->injectTestimonialRepository($this->testimonialRepository); } /**