Browse Source

Revert "Rolling a manual dataProvider, using the one from PHPUnit makes SQlite"

This reverts commit cb87b2d8afb544fb24d598c383bb4d4d4f64f2c4.
Jose Lorenzo Rodriguez 12 years ago
parent
commit
5fe720f39b
1 changed files with 8 additions and 43 deletions
  1. 8 43
      tests/TestCase/ORM/CompositeKeysTest.php

+ 8 - 43
tests/TestCase/ORM/CompositeKeysTest.php

@@ -61,35 +61,22 @@ class CompositeKeyTest extends TestCase {
 	}
 
 /**
- * Tests that HasMany associations are correctly eager loaded and results
- * correctly nested when multiple foreignKeys are used
- *
- * Uses the select strategy
+ * Data provider for the two types of strategies HasMany implements
  *
  * @return void
  */
-	public function testHasManyEagerSelect() {
-		$this->_testHasMany('select');
+	public function strategiesProvider() {
+		return [['subquery'], ['select']];
 	}
 
 /**
  * Tests that HasMany associations are correctly eager loaded and results
- * correctly nested when multiple foreignKeys are used.
- *
- * Uses the subquery startegy
- *
- * @return void
- */
-	public function testHasManyEagerSubquery() {
-		$this->_testHasMany('subquery');
-	}
-
-/**
- * Helper method used to test eager loading of hasMany associations
+ * correctly nested when multiple foreignKeys are used
  *
+ * @dataProvider strategiesProvider
  * @return void
  */
-	protected function _testHasMany($strategy) {
+	public function _testHasManyEager($strategy) {
 		$table = TableRegistry::get('SiteAuthors');
 		$table->hasMany('SiteArticles', [
 			'propertyName' => 'articles',
@@ -159,32 +146,10 @@ class CompositeKeyTest extends TestCase {
  * Tests that BelongsToMany associations are correctly eager loaded when multiple
  * foreignKeys are used
  *
- * Uses the select strategy
- *
+ * @dataProvider strategiesProvider
  * @return void
  **/
-	public function testBelongsToManyEagerSelect() {
-		$this->_testBelongsToMany('select');
-	}
-
-/**
- * Tests that BelongsToMany associations are correctly eager loaded when multiple
- * foreignKeys are used
- *
- * Uses the subquery strategy
- *
- * @return void
- **/
-	public function testBelongsToManyEagerSubquery() {
-		$this->_testBelongsToMany('subquery');
-	}
-
-/**
- * Helper method used to test eager loding of BelongsToMany associations
- *
- * @return void
- */
-	protected function _testBelongsToMany($strategy) {
+	public function _testBelongsToManyEager($strategy) {
 		$articles = TableRegistry::get('SiteArticles');
 		$tags = TableRegistry::get('SiteTags');
 		$junction = TableRegistry::get('SiteArticlesTags');