From f8670efe3aa4ee5459ae738f96e0eb8f109a0516 Mon Sep 17 00:00:00 2001 From: hthtung90 Date: Sat, 10 Jun 2017 11:41:41 +0700 Subject: [PATCH 1/2] Fixing wrong variable It should be `$validator` instead of `$this->validator` --- form/unit_testing.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/form/unit_testing.rst b/form/unit_testing.rst index 639e5936f1d..85efe3b1a90 100644 --- a/form/unit_testing.rst +++ b/form/unit_testing.rst @@ -185,10 +185,10 @@ allows you to return a list of extensions to register:: protected function getExtensions() { - $this->validator = $this->createMock(ValidatorInterface::class); + $validator = $this->createMock(ValidatorInterface::class); // use getMock() on PHPUnit 5.3 or below // $this->validator = $this->getMock(ValidatorInterface::class); - $this->validator + $validator ->method('validate') ->will($this->returnValue(new ConstraintViolationList())); $validator From 5d57546fc2303323c2e403326b0590eade669dfa Mon Sep 17 00:00:00 2001 From: hthtung90 Date: Sat, 10 Jun 2017 11:44:24 +0700 Subject: [PATCH 2/2] Update unit_testing.rst --- form/unit_testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/form/unit_testing.rst b/form/unit_testing.rst index 85efe3b1a90..9f20accdb53 100644 --- a/form/unit_testing.rst +++ b/form/unit_testing.rst @@ -187,7 +187,7 @@ allows you to return a list of extensions to register:: { $validator = $this->createMock(ValidatorInterface::class); // use getMock() on PHPUnit 5.3 or below - // $this->validator = $this->getMock(ValidatorInterface::class); + // $validator = $this->getMock(ValidatorInterface::class); $validator ->method('validate') ->will($this->returnValue(new ConstraintViolationList()));