コード例 #1
0
ファイル: MediaSizeTest.php プロジェクト: remi-san/twitter
 /**
  * @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());
 }
コード例 #2
0
 /**
  * @return TwitterMediaSize
  */
 private function getValidObject()
 {
     return TwitterMediaSize::create($this->name, $this->width, $this->height, $this->resize);
 }
コード例 #3
0
 /**
  * @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);
 }
コード例 #4
0
 private function givenMediaSerializerWillSerializeMedia()
 {
     $this->mediaSize->shouldReceive('getName')->andReturn($this->sizeName);
     $this->mediaSizeSerializer->shouldReceive('serialize')->with($this->mediaSize)->andReturn($this->serializedSize);
 }