/** * @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()); }
/** * @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); }
private function givenMediaSerializerWillSerializeMedia() { $this->mediaSize->shouldReceive('getName')->andReturn($this->sizeName); $this->mediaSizeSerializer->shouldReceive('serialize')->with($this->mediaSize)->andReturn($this->serializedSize); }