for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Moodle component manager.
*
* @author Luke Carrier <[email protected]>
* @copyright 2016 Luke Carrier
* @license GPL-3.0+
*/
use ComponentManager\ComponentSpecification;
use ComponentManager\MoodleVersion;
use PHPUnit\Framework\TestCase;
* @coversDefaultClass \ComponentManager\ComponentSpecification
class ComponentSpecificationTest extends TestCase {
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
public function testGetExtra() {
$extra = (object) [
'defined' => 'obviously',
];
$componentSpecification = new ComponentSpecification(
'type_name', '2015021800', null, null, $extra);
$this->assertEquals(
'obviously', $componentSpecification->getExtra('defined'));
$this->expectException(OutOfBoundsException::class);
$componentSpecification->getExtra('definitelyUndefined');
}
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.