Ejemplo n.º 1
0
 /**
  * @param Storage $storage
  */
 public function showAll(Storage $storage)
 {
     $groupHtml = '';
     foreach ($storage->getConfig()->getGroups() as $group) {
         $groupHtml .= $this->showGroup($group);
     }
     return $this->blade->view()->make('pages.overview', array('groupHtml' => $groupHtml));
 }
Ejemplo n.º 2
0
 /**
  * @test
  */
 public function postRequestCreateTag()
 {
     $link = $this->getMock('\\Bookmarks\\Link', array('addTag'));
     $link->url = '/test.html';
     $link->title = 'my new group';
     $group = $this->getMock('\\Bookmarks\\Group', array('getLink'));
     $group->expects($this->once())->method('getLink')->with($this->equalTo('linkId'))->will($this->returnValue($link));
     $this->config->expects($this->once())->method('getGroup')->with($this->equalTo('groupId'))->will($this->returnValue($group));
     $link->expects($this->once())->method('addTag')->with($this->equalTo('my new tag'));
     $this->storage->expects($this->once())->method('saveConfig')->with($this->config);
     $this->assertEquals('my new tag', $this->controller->parseRequest('POST', array('action' => 'createTag', 'group' => 'groupId', 'link' => 'linkId', 'text' => 'my new tag')));
 }