Each user (by design) has their own stack. No sharesies!
Author: Bob den Otter, bob@twokings.nl
示例#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));
 }
示例#2
0
文件: StackTest.php 项目: bolt/bolt
 public function testAddNonExistentFile()
 {
     $this->setExpectedException(FileNotFoundException::class);
     $this->stack->add('non_existent_file');
 }