"Invalid URL '%value%'."]; protected function setUp() { $objectManager = new ObjectManager($this); $this->zendValidator = $this->createMock(\Zend\Validator\Uri::class); $this->object = $objectManager->getObject( \Magento\Framework\Url\Validator::class, ['validator' => $this->zendValidator] ); } public function testConstruct() { $this->assertEquals($this->expectedValidationMessages, $this->object->getMessageTemplates()); } public function testIsValidWhenValid() { $this->zendValidator ->method('isValid') ->with('http://example.com') ->willReturn(true); $this->assertTrue($this->object->isValid('http://example.com')); $this->assertEquals([], $this->object->getMessages()); } public function testIsValidWhenInvalid() { $this->zendValidator ->method('isValid') ->with('%value%') ->willReturn(false); $this->assertFalse($this->object->isValid('%value%')); $this->assertEquals($this->expectedValidationMessages, $this->object->getMessages()); } }