Permalink
Browse files

cleaning up unit tests

  • Loading branch information...
1 parent e5c3b2e commit b0d45065266c5df82da8caaeaa3ea78487a7011f @EvanDotPro committed Aug 12, 2011
@@ -50,7 +50,7 @@ public function toArray($array = false)
$array[$key] = $value->toArray();
} elseif (is_array($value) && count($value) > 0) {
$array[$key] = $this->toArray($value);
- } else {
+ } elseif ($value !== NULL && !is_array($value)) {
$array[$key] = $value;
}
}
@@ -17,7 +17,7 @@ public function tearDown()
public function testModelIsEmpty()
{
- $this->assertInstanceOf('\\Core\\Model\\Manufacturer',$this->_model);
+ $this->assertInstanceOf('\Core\Model\Manufacturer',$this->_model);
$this->assertNull($this->_model->getManufacturerId());
$this->assertNull($this->_model->getName());
}
@@ -17,7 +17,7 @@ public function tearDown()
public function testModelIsEmpty()
{
- $this->assertInstanceOf('\\Core\\Model\\Product',$this->_model);
+ $this->assertInstanceOf('\Core\Model\Product',$this->_model);
$this->assertNull($this->_model->getProductId());
$this->assertNull($this->_model->getName());
$this->assertNull($this->_model->getItemNumber());
@@ -35,7 +35,6 @@ public function modelDataProvider()
),
'name' => 'My Product',
'item_number' => '123ABC',
- 'attributes' => array(),
))
);
}
@@ -51,10 +50,10 @@ public function testModelContainsCorrectData($data)
->setItemNumber($data['item_number'])
->setManufacturer($data['manufacturer']);
$manufacturer = $this->_model->getManufacturer();
- $this->assertInstanceOf('\\Core\\Model\\Manufacturer', $manufacturer);
+ $this->assertInstanceOf('\Core\Model\Manufacturer', $manufacturer);
$this->_model->setManufacturer($manufacturer);
$manufacturer = $this->_model->getManufacturer();
- $this->assertInstanceOf('\\Core\\Model\\Manufacturer', $manufacturer);
+ $this->assertInstanceOf('\Core\Model\Manufacturer', $manufacturer);
$this->assertSame($this->_model->toArray(), $data);
}
@@ -17,7 +17,7 @@ public function tearDown()
public function testModelIsEmpty()
{
- $this->assertInstanceOf('\\Core\\Model\\Uom',$this->_model);
+ $this->assertInstanceOf('\Core\Model\Uom',$this->_model);
$this->assertNull($this->_model->getUomCode());
$this->assertNull($this->_model->getDescription());
}
View
@@ -8,7 +8,10 @@
<directory suffix=".php">../application/</directory>
<directory suffix=".php">../library/</directory>
<exclude>
+ <directory>../library/ZendFramework2</directory>
<directory suffix=".phtml">../application/</directory>
+ <file>../application/init.php</file>
+ <file>../application/cli.php</file>
</exclude>
</whitelist>
</filter>

0 comments on commit b0d4506

Please sign in to comment.