for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* File ClearableTraitTest.php
*
* @author Edward Pfremmer <[email protected]>
*/
namespace Epfremme\Tests\Collection\Traits;
use Epfremme\Collection\Collection;
* Class ClearableTraitTest
* @package Epfremme\Tests\Collection\Traits
class ClearableTraitTest extends \PHPUnit_Framework_TestCase
{
* @var Collection
private $collection;
* {@inheritdoc}
public function setUp()
parent::setUp();
$this->collection = new Collection([1, 2, 3, 'a' => 4, 'b' => 5]);
}
* Test emptying collection
* @return void
public function testClear()
$this->collection->clear();
$this->assertAttributeEmpty('elements', $this->collection);
$this->assertAttributeCount(0, 'elements', $this->collection);
* Test collection empty method
public function testIsEmpty()
$this->assertFalse($this->collection->isEmpty());
$this->assertTrue($this->collection->isEmpty());