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+
*/
namespace ComponentManager\Test;
use ComponentManager\ComponentSpecification;
use OutOfBoundsException;
use PHPUnit\Framework\TestCase;
* @coversDefaultClass \ComponentManager\ComponentSpecification
class ComponentSpecificationTest extends TestCase {
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');
}