Each user (by design) has their own stack. No sharesies!
Author: Bob den Otter, bob@twokings.nl
Exemplo n.º 1
0
 public function testListFilter()
 {
     $app = $this->makeApp();
     $app['resources']->setPath('files', PHPUNIT_ROOT . '/resources/stack');
     $app->initialize();
     $users = $this->getMock('Bolt\\Users', array('getCurrentUser', 'saveUser'), array($app));
     $app['users'] = $users;
     $stack = new Stack($app);
     $stack->add('files/testing.md');
     $stack->add('files/testing.txt');
     $stack->add('files/test.jpg');
     $stack->add('files/test2.jpg');
     $items = $stack->listItems(100, 'image');
     $this->assertEquals(2, count($items));
     $items = $stack->listItems(100, 'document');
     $this->assertEquals(2, count($items));
 }
Exemplo n.º 2
0
 public function testAddNonExistentFile()
 {
     $this->setExpectedException(FileNotFoundException::class);
     $this->stack->add('non_existent_file');
 }