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)); }
public function testAddNonExistentFile() { $this->setExpectedException(FileNotFoundException::class); $this->stack->add('non_existent_file'); }