Skip to content

Commit

Permalink
Revert unit tests back to way they used to be.
Browse files Browse the repository at this point in the history
  • Loading branch information
posulliv committed Aug 24, 2012
1 parent f7b0275 commit 316ee6d
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 316ee6d

Please sign in to comment.