phpmyadmin/test/libraries/core/PMA_ifSetOr_test.php
Michal Čihař b450e58dbb Remove require of libraries included in test bootstrap
There is no need to specify them in every test when we already do it
globally.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-01-12 16:43:16 +01:00

70 lines
1.2 KiB
PHP

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
*
* @package PhpMyAdmin-test
*/
/*
* Include to test.
*/
/**
*
* @package PhpMyAdmin-test
*/
class PMA_IfSetOr_Test extends PHPUnit_Framework_TestCase
{
/**
* Test for PMA_ifSetOr
*
* @return void
*/
public function testVarSet()
{
$default = 'foo';
$in = 'bar';
$out = PMA_ifSetOr($in, $default);
$this->assertEquals($in, $out);
}
/**
* Test for PMA_ifSetOr
*
* @return void
*/
public function testVarSetWrongType()
{
$default = 'foo';
$in = 'bar';
$out = PMA_ifSetOr($in, $default, 'boolean');
$this->assertEquals($out, $default);
}
/**
* Test for PMA_ifSetOr
*
* @return void
*/
public function testVarNotSet()
{
$default = 'foo';
// $in is not set!
$out = PMA_ifSetOr($in, $default);
$this->assertEquals($out, $default);
}
/**
* Test for PMA_ifSetOr
*
* @return void
*/
public function testVarNotSetNoDefault()
{
// $in is not set!
$out = PMA_ifSetOr($in);
$this->assertEquals($out, null);
}
}