Ejemplo n.º 1
0
 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]);
 }
Ejemplo n.º 2
0
 /**
  * getMessages interface for Zend\Validator\ValidatorInterface
  *
  * @return array
  */
 public function getMessages()
 {
     return array_map(function (StringType $msg) {
         return $msg();
     }, $this->messenger->get());
 }