First commit
This commit is contained in:
commit
d5bb2f19fa
117 changed files with 68604 additions and 0 deletions
71
vendor/yosymfony/toml/tests/TomlArrayTest.php
vendored
Normal file
71
vendor/yosymfony/toml/tests/TomlArrayTest.php
vendored
Normal file
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Yosymfony Toml.
|
||||
*
|
||||
* (c) YoSymfony <http://github.com/yosymfony>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Yosymfony\Toml\tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Yosymfony\Toml\TomlArray;
|
||||
|
||||
class TomlArrayTest extends TestCase
|
||||
{
|
||||
/** @var TomlArray */
|
||||
private $tomlArray;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->tomlArray = new TomlArray();
|
||||
}
|
||||
|
||||
public function tearDown()
|
||||
{
|
||||
$this->tomlArray = null;
|
||||
}
|
||||
|
||||
public function testGetArrayMustReturnTheKeyValueAdded() : void
|
||||
{
|
||||
$this->tomlArray->addKeyValue('company', 'acme');
|
||||
|
||||
$this->assertEquals([
|
||||
'company' => 'acme'
|
||||
], $this->tomlArray->getArray());
|
||||
}
|
||||
|
||||
public function testGetArrayMustReturnTheTableWithTheKeyValue() : void
|
||||
{
|
||||
$this->tomlArray->addTableKey('companyData');
|
||||
$this->tomlArray->addKeyValue('company', 'acme');
|
||||
|
||||
$this->assertEquals([
|
||||
'companyData' => [
|
||||
'company' => 'acme'
|
||||
],
|
||||
], $this->tomlArray->getArray());
|
||||
}
|
||||
|
||||
public function testGetArrayMustReturnAnArrayOfTables() : void
|
||||
{
|
||||
$this->tomlArray->addArrayTableKey('companyData');
|
||||
$this->tomlArray->addKeyValue('company', 'acme1');
|
||||
$this->tomlArray->addArrayTableKey('companyData');
|
||||
$this->tomlArray->addKeyValue('company', 'acme2');
|
||||
|
||||
$this->assertEquals([
|
||||
'companyData' => [
|
||||
[
|
||||
'company' => 'acme1'
|
||||
],
|
||||
[
|
||||
'company' => 'acme2'
|
||||
],
|
||||
]
|
||||
], $this->tomlArray->getArray());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue