Initial commit

This commit is contained in:
2022-11-21 09:47:28 +01:00
commit 76cec83d26
11652 changed files with 1980467 additions and 0 deletions

View File

@ -0,0 +1,72 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* tests for PMA\libraries\properties\plugins\ExportPluginProperties class
*
* @package PhpMyAdmin-test
*/
use PMA\libraries\properties\plugins\ExportPluginProperties;
require_once 'test/classes/properties/plugins/ImportPluginPropertiesTest.php';
/**
* Tests for PMA\libraries\properties\plugins\ExportPluginProperties class. Extends PMA_ImportPluginProperties_Tests
* and adds tests for methods that are not common to both
*
* @package PhpMyAdmin-test
*/
class ExportPluginPropertiesTest extends ImportPluginPropertiesTest
{
protected $object;
/**
* Configures global environment.
*
* @return void
*/
protected function setup()
{
$this->object = new ExportPluginProperties();
}
/**
* tearDown for test cases
*
* @return void
*/
public function tearDown()
{
unset($this->object);
}
/**
* Test for PMA\libraries\properties\plugins\ExportPluginProperties::getItemType
*
* @return void
*/
public function testGetItemType()
{
$this->assertEquals(
'export',
$this->object->getItemType()
);
}
/**
* Test for
* - PMA\libraries\properties\plugins\ExportPluginProperties::getForceFile
* - PMA\libraries\properties\plugins\ExportPluginProperties::setForceFile
*
* @return void
*/
public function testSetGetForceFile()
{
$this->object->setForceFile(true);
$this->assertTrue(
$this->object->getForceFile()
);
}
}

View File

@ -0,0 +1,87 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* tests for PMA\libraries\properties\plugins\ImportPluginProperties class
*
* @package PhpMyAdmin-test
*/
use PMA\libraries\properties\plugins\ImportPluginProperties;
/**
* tests for PMA\libraries\properties\plugins\ImportPluginProperties class
*
* @package PhpMyAdmin-test
*/
class ImportPluginPropertiesTest extends PHPUnit_Framework_TestCase
{
protected $object;
/**
* Configures global environment.
*
* @return void
*/
protected function setup()
{
$this->object = new ImportPluginProperties();
}
/**
* tearDown for test cases
*
* @return void
*/
protected function tearDown()
{
unset($this->object);
}
/**
* Test for PMA\libraries\properties\plugins\ImportPluginProperties::getItemType
*
* @return void
*/
public function testGetItemType()
{
$this->assertEquals(
'import',
$this->object->getItemType()
);
}
/**
* Test for
* - PMA\libraries\properties\plugins\ImportPluginProperties::getOptionsText
* - PMA\libraries\properties\plugins\ImportPluginProperties::setOptionsText
*
* @return void
*/
public function testSetGetOptionsText()
{
$this->object->setOptionsText('options123');
$this->assertEquals(
'options123',
$this->object->getOptionsText()
);
}
/**
* Test for
* - PMA\libraries\properties\plugins\ImportPluginProperties::setMimeType
* - PMA\libraries\properties\plugins\ImportPluginProperties::getMimeType
*
* @return void
*/
public function testSetGetMimeType()
{
$this->object->setMimeType('mime123');
$this->assertEquals(
'mime123',
$this->object->getMimeType()
);
}
}

View File

@ -0,0 +1,56 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* tests for PMA\libraries\properties\plugins\PluginPropertyItem class
*
* @package PhpMyAdmin-test
*/
/**
* Tests for PMA\libraries\properties\plugins\PluginPropertyItem class
*
* @package PhpMyAdmin-test
*/
class PluginPropertyItemTest extends PHPUnit_Framework_TestCase
{
protected $stub;
/**
* Configures global environment.
*
* @return void
*/
protected function setup()
{
$this->stub = $this->getMockForAbstractClass('PMA\libraries\properties\plugins\PluginPropertyItem');
}
/**
* tearDown for test cases
*
* @return void
*/
public function tearDown()
{
unset($this->stub);
}
/**
* Test for PMA\libraries\properties\plugins\PluginPropertyItem::getPropertyType
*
* @return void
*/
public function testGetPropertyType()
{
if ((defined('HHVM_VERSION')
&& (version_compare(constant('HHVM_VERSION'), '3.8', 'lt')))
) {
$this->markTestSkipped('Due to a bug in early versions of HHVM, this test cannot be completed.');
}
$this->assertEquals(
"plugin",
$this->stub->getPropertyType()
);
}
}