Formatting

This commit is contained in:
R. Eric Wheeler 2016-07-19 15:02:23 -07:00
parent 2c39931e93
commit b81066a259
2 changed files with 37 additions and 42 deletions

View File

@ -16,7 +16,7 @@ $finder = Symfony\CS\Finder\DefaultFinder::create()
->ignoreDotFiles(true) ->ignoreDotFiles(true)
->ignoreVCS(true) ->ignoreVCS(true)
->name('*.php') ->name('*.php')
->in(__DIR__ . '/src') ->in(__DIR__)
; ;
return Symfony\CS\Config\Config::create() return Symfony\CS\Config\Config::create()

View File

@ -1,12 +1,9 @@
<?php <?php
/**
/*
* This file is part of ArrayObjectArray. * This file is part of ArrayObjectArray.
* *
* @file ArrayObjectArrayTest.php * (copyleft) R. Eric Wheeler <sikofitt@gmail.com>
*
* R. Eric Wheeler <reric@ee.stanford.edu>
*
* 7/19/16 / 1:58 PM
* *
* For the full copyright and license information, please view the LICENSE * For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
@ -14,58 +11,56 @@
namespace Sikofitt\Tests; namespace Sikofitt\Tests;
use Sikofitt\Utility\ArrayObjectArray; use Sikofitt\Utility\ArrayObjectArray;
/** /**
* Class ArrayObjectArrayTest * Class ArrayObjectArrayTest.
*
* @package Sikofitt\Tests
*/ */
class ArrayObjectArrayTest extends \PHPUnit_Framework_TestCase { class ArrayObjectArrayTest extends \PHPUnit_Framework_TestCase
{
private $arrayObjectArray;
private $workingArray;
private $arrayObjectArray; public function setUp()
private $workingArray; {
$this->workingArray = array(
public function setUp() { 'this' => 'that',
$this->workingArray = array( 'that' => 'this',
'this' => 'that', 'what' => 'who',
'that' => 'this',
'what' => 'who',
'check' => 'out', 'check' => 'out',
); );
$this->arrayObjectArray = new ArrayObjectArray($this->workingArray); $this->arrayObjectArray = new ArrayObjectArray($this->workingArray);
}
}
/** /**
* @coversDefaultClass * @coversDefaultClass
*/ */
public function testArrayObjectArrayInstance() { public function testArrayObjectArrayInstance()
$this->assertInstanceOf(ArrayObjectArray::class, $this->arrayObjectArray);
$this->assertInstanceOf(\ArrayObject::class, $this->arrayObjectArray);
}
public function testArrayKeys()
{ {
$this->assertEquals(array_keys($this->workingArray), $this->arrayObjectArray->array_keys()); $this->assertInstanceOf(ArrayObjectArray::class, $this->arrayObjectArray);
$this->assertEquals(array_values($this->workingArray), $this->arrayObjectArray->array_values()); $this->assertInstanceOf(\ArrayObject::class, $this->arrayObjectArray);
$this->assertEquals($this->workingArray, $this->arrayObjectArray->getArrayCopy());
$this->assertCount(4, $this->arrayObjectArray);
$this->arrayObjectArray->offsetUnset('this');
$this->assertCount(3, $this->arrayObjectArray);
$this->arrayObjectArray->append(['this' => 'that']);
$this->assertCount(4, $this->arrayObjectArray);
} }
public function testArrayKeys()
{
$this->assertSame(array_keys($this->workingArray), $this->arrayObjectArray->array_keys());
$this->assertSame(array_values($this->workingArray), $this->arrayObjectArray->array_values());
$this->assertSame($this->workingArray, $this->arrayObjectArray->getArrayCopy());
$this->assertCount(4, $this->arrayObjectArray);
$this->arrayObjectArray->offsetUnset('this');
$this->assertCount(3, $this->arrayObjectArray);
$this->arrayObjectArray->append(array('this' => 'that'));
$this->assertCount(4, $this->arrayObjectArray);
}
/** /**
* @expectedException \BadMethodCallException * @expectedException \BadMethodCallException
*/ */
public function testException() public function testException()
{ {
$this->arrayObjectArray->error(); $this->arrayObjectArray->error();
} }
} }