Exemplo n.º 1
0
 /**
  * @test
  */
 public function itShouldBuildTheObject()
 {
     $mediaSize = TwitterMediaSize::create($this->name, $this->width, $this->height, $this->resize);
     $this->assertEquals($this->name, $mediaSize->getName());
     $this->assertEquals($this->width, $mediaSize->getWidth());
     $this->assertEquals($this->height, $mediaSize->getHeight());
     $this->assertEquals($this->resize, $mediaSize->getResize());
 }
Exemplo n.º 2
0
 /**
  * @return TwitterMediaSize
  */
 private function getValidObject()
 {
     return TwitterMediaSize::create($this->name, $this->width, $this->height, $this->resize);
 }
 /**
  * @param  \stdClass $obj
  * @param  array     $context
  * @return TwitterMediaSize
  */
 public function unserialize($obj, array $context = [])
 {
     Assertion::true($this->canUnserialize($obj), 'object is not unserializable');
     return TwitterMediaSize::create($context[self::NAME_VAR], $obj->w, $obj->h, $obj->resize);
 }