/** * @param string $text */ public function __construct($text = null) { if (strlen($text) > self::MAX_LENGTH) { throw new TitleTooLongException($text, self::MAX_LENGTH); } parent::__construct($text); }
function it_is_not_equal_to_different_text(Text $text) { $text->getText()->willReturn('Some other string'); $this->equals($text)->shouldBe(false); }
function it_slugifies_a_text(Text $text) { $text->__toString()->willReturn('someCrazyTTText'); $this->slugify($text)->shouldBeAnInstanceOf(Slug::class); }