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)
->ignoreVCS(true)
->name('*.php')
->in(__DIR__ . '/src')
->in(__DIR__)
;
return Symfony\CS\Config\Config::create()

View File

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