silverstripe-framework/tests/php/Core/Manifest/ConfigStaticManifestTest.php

39 lines
1.0 KiB
PHP
Raw Normal View History

2013-03-12 03:32:46 +01:00
<?php
namespace SilverStripe\Core\Tests\Manifest;
2016-09-09 08:43:05 +02:00
use SilverStripe\Core\Manifest\ConfigStaticManifest;
use SilverStripe\Dev\SapphireTest;
class ConfigStaticManifestTest extends SapphireTest
{
private static $testString = 'string';
2013-03-12 03:32:46 +01:00
private static $testArray = array('foo' => 'bar');
2013-03-12 03:32:46 +01:00
protected static $ignored = true;
2013-03-12 03:32:46 +01:00
public function testGet()
{
$manifest = new ConfigStaticManifest();
// Test madeup value
$this->assertNull($manifest->get(__CLASS__, 'madeup', null));
// Test string value
$this->assertEquals('string', $manifest->get(__CLASS__, 'testString'));
2013-03-12 03:32:46 +01:00
// Test array value
$this->assertEquals(array('foo' => 'bar'), $manifest->get(__CLASS__, 'testArray'));
// Test to ensure we're only picking up private statics
$this->assertNull($manifest->get(__CLASS__, 'ignored', null));
// Test madeup class
if (!class_exists('aonsffgrgx')) {
$this->assertNull($manifest->get('aonsffgrgx', 'madeup', null));
}
}
}