Browse files

Fixed tests.

Two things were fixed:
* assertType() was replaced by assertInternalType() to make that tests can work with latest stable phpunit version
* one mock expectation was updated to prevent it from failing
  • Loading branch information...
1 parent fff3fd7 commit 3b1d78c9a9f874d19e575e943b912f906638d84f @jakzal jakzal committed with Wojtek Oledzki May 13, 2012
Showing with 10 additions and 10 deletions.
  1. +10 −10 tests/lib/Phabric/PhabricTest.php
View
20 tests/lib/Phabric/PhabricTest.php
@@ -49,21 +49,21 @@ protected function tearDown() {
public function testCreateEntity() {
$entity = $this->object->createEntity('Event');
- $this->assertType('\Phabric\Entity', $entity);
+ $this->assertInstanceOf('\Phabric\Entity', $entity);
}
public function testCreateEntityWithConfig() {
$entity = $this->object->createEntity('Event', array('tableName' => 'event'));
- $this->assertType('\Phabric\Entity', $entity);
+ $this->assertInstanceOf('\Phabric\Entity', $entity);
}
public function testCreateEntityHasRegisteredEntity() {
$this->object->createEntity('Event');
$entity = $this->object->getEntity('Event');
- $this->assertType('\Phabric\Entity', $entity);
+ $this->assertInstanceOf('\Phabric\Entity', $entity);
}
public function testAddDataTransformation() {
@@ -107,7 +107,7 @@ public function testInsertFromTable() {
$mockEntity = m::mock('\Phabric\Entity');
$mockEntity->shouldReceive('insertFromTable')
- ->with($tableNode, true)
+ ->with($tableNode, m::any())
->once();
$this->object->addEntity('TEST', $mockEntity);
@@ -132,12 +132,12 @@ public function testCreateEntitiesFromConfig() {
$this->object->createEntitiesFromConfig($config);
- $this->assertType('Phabric\Entity', $this->object->getEntity('event'));
- $this->assertType('Phabric\Entity', $this->object->getEntity('vote'));
- $this->assertType('Phabric\Entity', $this->object->getEntity('session'));
+ $this->assertInstanceOf('Phabric\Entity', $this->object->getEntity('event'));
+ $this->assertInstanceOf('Phabric\Entity', $this->object->getEntity('vote'));
+ $this->assertInstanceOf('Phabric\Entity', $this->object->getEntity('session'));
}
- public function testUpdateFromTable()
+ public function testUpdateFromTable()
{
$tableNode = m::mock('\Behat\Gherkin\Node\TableNode');
@@ -151,11 +151,11 @@ public function testUpdateFromTable()
$this->object->updateFromTable('TEST', $tableNode);
}
-
+
/**
* @expectedException InvalidArgumentException
*/
- public function testUpdateFromTableThrowsExceptionWhenUnregEntity()
+ public function testUpdateFromTableThrowsExceptionWhenUnregEntity()
{
$tableNode = m::mock('\Behat\Gherkin\Node\TableNode');

0 comments on commit 3b1d78c

Please sign in to comment.