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,20 +11,18 @@
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 $arrayObjectArray;
private $workingArray; private $workingArray;
public function setUp() { public function setUp()
{
$this->workingArray = array( $this->workingArray = array(
'this' => 'that', 'this' => 'that',
'that' => 'this', 'that' => 'this',
@ -35,31 +30,32 @@ class ArrayObjectArrayTest extends \PHPUnit_Framework_TestCase {
'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(ArrayObjectArray::class, $this->arrayObjectArray);
$this->assertInstanceOf(\ArrayObject::class, $this->arrayObjectArray); $this->assertInstanceOf(\ArrayObject::class, $this->arrayObjectArray);
} }
public function testArrayKeys() public function testArrayKeys()
{ {
$this->assertEquals(array_keys($this->workingArray), $this->arrayObjectArray->array_keys()); $this->assertSame(array_keys($this->workingArray), $this->arrayObjectArray->array_keys());
$this->assertEquals(array_values($this->workingArray), $this->arrayObjectArray->array_values()); $this->assertSame(array_values($this->workingArray), $this->arrayObjectArray->array_values());
$this->assertEquals($this->workingArray, $this->arrayObjectArray->getArrayCopy()); $this->assertSame($this->workingArray, $this->arrayObjectArray->getArrayCopy());
$this->assertCount(4, $this->arrayObjectArray); $this->assertCount(4, $this->arrayObjectArray);
$this->arrayObjectArray->offsetUnset('this'); $this->arrayObjectArray->offsetUnset('this');
$this->assertCount(3, $this->arrayObjectArray); $this->assertCount(3, $this->arrayObjectArray);
$this->arrayObjectArray->append(['this' => 'that']); $this->arrayObjectArray->append(array('this' => 'that'));
$this->assertCount(4, $this->arrayObjectArray); $this->assertCount(4, $this->arrayObjectArray);
} }
/** /**
* @expectedException \BadMethodCallException * @expectedException \BadMethodCallException
*/ */
@ -67,5 +63,4 @@ class ArrayObjectArrayTest extends \PHPUnit_Framework_TestCase {
{ {
$this->arrayObjectArray->error(); $this->arrayObjectArray->error();
} }
} }