Example #1
0
 /**
  * @test
  */
 public function getConfigIgnoresMissingFileAndReturnsNewConfig()
 {
     $storage = new \Bookmarks\Storage("any unkown file");
     /** @var \Bookmarks\Config $actual */
     $actual = $storage->getConfig();
     $this->assertInstanceOf('Bookmarks\\Config', $actual);
 }
Example #2
0
 /**
  * @test
  */
 public function showAllReplacesUserVariables()
 {
     $storage = new \Bookmarks\Storage(__DIR__ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'links.json');
     $group = new \Bookmarks\Group();
     $group->title = "my new {domain}";
     $storage->getConfig()->addGroup($group);
     $env = new \Bookmarks\Environment();
     $env->inject('domain', 'abc');
     $view = new \Bookmarks\View();
     $view->injectEnvironment($env);
     $actual = (string) $view->showAll($storage);
     $this->assertStringContains('my new abc', $actual, 'html should replace {domain} and contain "my new abc"');
 }