This repository has been archived on 2025-01-19. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
drupalcampbristol/vendor/dflydev/placeholder-resolver/tests/Dflydev/PlaceholderResolver/DataSource/ArrayDataSourceTest.php

49 lines
1.3 KiB
PHP
Raw Normal View History

2018-11-23 12:29:20 +00:00
<?php
/*
* This file is a part of dflydev/placeholder-resolver.
*
* (c) Dragonfly Development Inc.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Dflydev\PlaceholderResolver\DataSource;
/**
* ArrayDataSource Test
*
* @author Beau Simensen <beau@dflydev.com>
*/
class ArrayDataSourceTest extends \PHPUnit_Framework_TestCase
{
/**
* Test basic functionality
*/
public function testBasic()
{
$dataSource = new ArrayDataSource(array(
'a' => 'A',
'b' => 'B',
'c' => 'C',
));
$this->assertTrue($dataSource->exists('a'));
$this->assertTrue($dataSource->exists('b'));
$this->assertTrue($dataSource->exists('c'));
$this->assertFalse($dataSource->exists('d'));
$this->assertFalse($dataSource->exists('a', true));
$this->assertFalse($dataSource->exists('d', true));
$this->assertEquals('A', $dataSource->get('a'));
$this->assertEquals('B', $dataSource->get('b'));
$this->assertEquals('C', $dataSource->get('c'));
$this->assertNull($dataSource->get('d'));
$this->assertNull($dataSource->get('a', true));
$this->assertNull($dataSource->get('d', true));
}
}