Skip to content

Commit

Permalink
Fix minor object parameter conflict with PHPUnit.
Browse files Browse the repository at this point in the history
  • Loading branch information
reinink committed Sep 28, 2014
1 parent 199608d commit d34c951
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/Template/DataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,42 @@

class DataTest extends \PHPUnit_Framework_TestCase
{
private $data;
private $template_data;

public function setUp()
{
$this->data = new Data;
$this->template_data = new Data;
}

public function testCanCreateInstance()
{
$this->assertInstanceOf('League\Plates\Template\Data', $this->data);
$this->assertInstanceOf('League\Plates\Template\Data', $this->template_data);
}

public function testAddData()
{
$this->data->add(array('name' => 'Jonathan'));
$data = $this->data->get();
$this->template_data->add(array('name' => 'Jonathan'));
$data = $this->template_data->get();
$this->assertEquals($data['name'], 'Jonathan');
}

public function testAddDataWithTemplate()
{
$this->data->add(array('name' => 'Jonathan'), 'template');
$data = $this->data->get('template');
$this->template_data->add(array('name' => 'Jonathan'), 'template');
$data = $this->template_data->get('template');
$this->assertEquals($data['name'], 'Jonathan');
}

public function testAddDataWithTemplates()
{
$this->data->add(array('name' => 'Jonathan'), array('template1', 'template2'));
$data = $this->data->get('template1');
$this->template_data->add(array('name' => 'Jonathan'), array('template1', 'template2'));
$data = $this->template_data->get('template1');
$this->assertEquals($data['name'], 'Jonathan');
}

public function testAddDataWithInvalidTemplateFileType()
{
$this->setExpectedException('LogicException', 'The templates variable must be null, an array or a string, integer given.');
$this->data->add(array('name' => 'Jonathan'), 123);
$this->template_data->add(array('name' => 'Jonathan'), 123);
}
}

0 comments on commit d34c951

Please sign in to comment.