mirror of
https://github.com/Mibew/design.git
synced 2025-05-07 19:13:08 +03:00
62 lines
1.5 KiB
PHP
62 lines
1.5 KiB
PHP
<?php
|
|
|
|
require_once dirname(__FILE__) . '/../../../../webim/libs/classes/mibew_api_interaction.php';
|
|
require_once dirname(__FILE__) . '/mibew_api_test_interaction.php';
|
|
|
|
/**
|
|
* Test class for MibewAPIInteraction.
|
|
*/
|
|
class MibewAPIInteractionTest extends PHPUnit_Framework_TestCase {
|
|
|
|
/**
|
|
* An instance of the MibewAPITestInteraction
|
|
* @var MibewAPITestInteraction
|
|
*/
|
|
protected $object = null;
|
|
|
|
protected function setUp() {
|
|
$this->object = new MibewAPITestInteraction();
|
|
}
|
|
|
|
protected function tearDown() {
|
|
unset($this->object);
|
|
}
|
|
|
|
public function testGetObligatoryArguments() {
|
|
// Test obligatory arguments for all functions
|
|
$this->assertEquals(
|
|
$this->object->getObligatoryArguments('some_default_function'),
|
|
array('return', 'references')
|
|
);
|
|
|
|
// Test obligatory argumens for specific function
|
|
$this->assertEquals(
|
|
$this->object->getObligatoryArguments('foo'),
|
|
array('return', 'references', 'bar')
|
|
);
|
|
}
|
|
|
|
public function testGetObligatoryArgumentsDefaults() {
|
|
// Test default values for obligatory arguments for all functions
|
|
$this->assertEquals(
|
|
$this->object->getObligatoryArgumentsDefaults('some_default_function'),
|
|
array(
|
|
'return' => array(),
|
|
'references' => array()
|
|
)
|
|
);
|
|
|
|
// Test default values for obligatory argumens for specific function
|
|
$this->assertEquals(
|
|
$this->object->getObligatoryArgumentsDefaults('foo'),
|
|
array(
|
|
'return' => array(),
|
|
'references' => array(),
|
|
'bar' => 127
|
|
)
|
|
);
|
|
}
|
|
}
|
|
|
|
?>
|