Esempio n. 1
0
 /**
  * @expectedException \Exception
  */
 public function testChanWrongType2()
 {
     // given
     $entity = "foo";
     $ch = new Chan(Foo::getClass(), $this->driver, $this->mapper);
     // when
     $ch->add($entity);
 }
Esempio n. 2
0
 public function testMarshalChan()
 {
     // given
     $entities = [new Chan(null, $this->driver, $this->mapper), new Chan(null, $this->driver, $this->mapper, uniqid()), new Chan(Chan::CLASSNAME, $this->driver, $this->mapper), new Chan(Chan::CLASSNAME, $this->driver, $this->mapper, uniqid()), new Chan(Foo::getClass(), $this->driver, $this->mapper), new Chan(Foo::getClass(), $this->driver, $this->mapper, uniqid()), null];
     foreach ($entities as $entity) {
         // when
         $vo = $this->mapper->marshalArg($entity, Chan::CLASSNAME);
         $found = $this->mapper->unmarshalArg($vo, Chan::CLASSNAME);
         // then
         $this->assertEquals($entity, $found, 'Unmarshalled vos should match original entities');
     }
 }