mirror of
https://github.com/wiosna-dev/limesurvey-api-client.git
synced 2026-03-12 10:11:49 +01:00
composer.json - move tests-related classes to "autoload-dev" section (used for development purposes only and avoid polluting the autoloader in production)
This commit is contained in:
51
tests/Base/Result/BaseItemTest.php
Normal file
51
tests/Base/Result/BaseItemTest.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* (c) Meritoo.pl, http://www.meritoo.pl
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Meritoo\LimeSurvey\Test\ApiClient\Base\Result;
|
||||
|
||||
use Meritoo\Common\Test\Base\BaseTestCase;
|
||||
use Meritoo\LimeSurvey\ApiClient\Base\Result\BaseItem;
|
||||
|
||||
/**
|
||||
* Test case of the base class for one item of result/data fetched while talking to the LimeSurvey's API
|
||||
*
|
||||
* @author Krzysztof Niziol <krzysztof.niziol@meritoo.pl>
|
||||
* @copyright Meritoo.pl
|
||||
*/
|
||||
class BaseItemTest extends BaseTestCase
|
||||
{
|
||||
public function testConstructorVisibilityAndArguments()
|
||||
{
|
||||
static::assertHasNoConstructor(BaseItem::class);
|
||||
}
|
||||
|
||||
public function testSetValues()
|
||||
{
|
||||
$mock = $this->getBaseItemMock();
|
||||
|
||||
static::assertInstanceOf(BaseItem::class, $mock->setValues([]));
|
||||
static::assertInstanceOf(BaseItem::class, $mock->setValues(['lorem']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns mock of the tested class
|
||||
*
|
||||
* @return BaseItem
|
||||
*/
|
||||
private function getBaseItemMock()
|
||||
{
|
||||
$mock = $this->getMockForAbstractClass(BaseItem::class);
|
||||
|
||||
$mock
|
||||
->expects(static::any())
|
||||
->method('setValue')
|
||||
->willReturn(null);
|
||||
|
||||
return $mock;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user