Permalink
Browse files

Revert unit tests back to way they used to be.

  • Loading branch information...
1 parent f7b0275 commit 316ee6d62abe41bc9c4b75d5aafe5a8de414fbd7 @posulliv committed Aug 24, 2012
Showing with 9 additions and 23 deletions.
  1. +9 −23 tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
@@ -419,18 +419,12 @@ public function testFetchAllSupportFetchClass()
__NAMESPACE__.'\\MyFetchClass'
);
- $resObj = null;
- if (is_array($results)) {
- $resObj = $results[0];
- } else {
- $resObj = $results;
- }
- $this->assertEquals(1, count($resObj));
- $this->assertInstanceOf(__NAMESPACE__.'\\MyFetchClass', $resObj);
+ $this->assertEquals(1, count($results));
+ $this->assertInstanceOf(__NAMESPACE__.'\\MyFetchClass', $results[0]);
- $this->assertEquals(1, $resObj->test_int);
- $this->assertEquals('foo', $resObj->test_string);
- $this->assertStringStartsWith('2010-01-01 10:10:10', $resObj->test_datetime);
+ $this->assertEquals(1, $results[0]->test_int);
+ $this->assertEquals('foo', $results[0]->test_string);
+ $this->assertEquals('foo', $results[0]->test_string);
}
/**
@@ -465,19 +459,11 @@ public function testSetFetchModeClassFetchAll()
$results = $stmt->fetchAll();
$this->assertEquals(1, count($results));
+ $this->assertInstanceOf(__NAMESPACE__.'\\MyFetchClass', $results[0]);
- $resObj = null;
- if (is_array($results)) {
- $resObj = $results[0];
- } else {
- $resObj = $results;
- }
-
- $this->assertInstanceOf(__NAMESPACE__.'\\MyFetchClass', $resObj);
-
- $this->assertEquals(1, $resObj->test_int);
- $this->assertEquals('foo', $resObj->test_string);
- $this->assertStringStartsWith('2010-01-01 10:10:10', $resObj->test_datetime);
+ $this->assertEquals(1, $results[0]->test_int);
+ $this->assertEquals('foo', $results[0]->test_string);
+ $this->assertStringStartsWith('2010-01-01 10:10:10', $results[0]->test_datetime);
}
/**

0 comments on commit 316ee6d

Please sign in to comment.