/** * add action - adds a blog to the repository * * @param \Lobacher\Simpleblog\Domain\Model\Blog &$blog * @param array $extraInfo */ public function setTitleToBlog(\Lobacher\Simpleblog\Domain\Model\Blog &$blog, array $extraInfo) { if (!isset($extraInfo['name'])) { return; } $extraName = trim(implode(" ", array_map('trim', $extraInfo['name']))); $blog->setTitle($blog->getTitle() . ($extraName ? ' ' . $extraName : '')); }
/** * @test */ public function setTitleForStringSetsTitle() { $this->subject->setTitle('Conceived at T3CON10'); $this->assertAttributeEquals('Conceived at T3CON10', 'title', $this->subject); }