public function testCallingGetWillReturnAnArrayOfStringTypeMessages() { $this->sut->add(new StringType('foo')); $ret = $this->sut->get(); $this->assertInternalType('array', $ret); $this->assertEquals(1, count($ret)); $this->assertInstanceOf('\\Chippyash\\Type\\String\\StringType', $ret[0]); }
/** * getMessages interface for Zend\Validator\ValidatorInterface * * @return array */ public function getMessages() { return array_map(function (StringType $msg) { return $msg(); }, $this->messenger->get()); }