mirror of
https://github.com/splitbrain/dokuwiki-plugin-gallery.git
synced 2025-07-27 13:00:23 +00:00

This splits up all the code in classes and cleans everything up. A very few tests have been added. HTML has been simplified. Next up: frontend refactoring
44 lines
964 B
PHP
44 lines
964 B
PHP
<?php
|
|
|
|
namespace dokuwiki\plugin\gallery\test;
|
|
|
|
use dokuwiki\plugin\gallery\classes\NamespaceGallery;
|
|
use dokuwiki\plugin\gallery\classes\Options;
|
|
use DokuWikiTest;
|
|
|
|
/**
|
|
* Namespace Gallery tests for the gallery plugin
|
|
*
|
|
* @group plugin_gallery
|
|
* @group plugins
|
|
*/
|
|
class NamespaceGalleryTest extends DokuWikiTest
|
|
{
|
|
protected $pluginsEnabled = ['gallery'];
|
|
|
|
/**
|
|
* Copy demo images to the media directory
|
|
*
|
|
* @inheritdoc
|
|
*/
|
|
public static function setUpBeforeClass(): void
|
|
{
|
|
parent::setUpBeforeClass();
|
|
global $conf;
|
|
\TestUtils::rcopy($conf['mediadir'], __DIR__ . '/data/media/gallery');
|
|
}
|
|
|
|
|
|
/**
|
|
* Check that the images are returned correctly
|
|
*/
|
|
public function testGetImages()
|
|
{
|
|
$gallery = new NamespaceGallery('gallery', new Options());
|
|
|
|
$images = $gallery->getImages();
|
|
$this->assertIsArray($images);
|
|
$this->assertCount(3, $images);
|
|
}
|
|
}
|