Browse Source

IntegrationTestCase

euromark 11 years ago
parent
commit
36cae307e5
3 changed files with 32 additions and 2 deletions
  1. 1 1
      docs/Upgrade.md
  2. 1 1
      src/Model/Behavior/SluggedBehavior.php
  3. 30 0
      src/TestSuite/IntegrationTestCase.php

+ 1 - 1
docs/Upgrade.md

@@ -22,4 +22,4 @@
 ## Behavior
 ## Behavior
 - `run`/`before` config options for callback decisions have been unified to `on` and complete callback/event name, e.g. `'on' => 'beforeValidate'`.
 - `run`/`before` config options for callback decisions have been unified to `on` and complete callback/event name, e.g. `'on' => 'beforeValidate'`.
 - model names are now table names, and plural.
 - model names are now table names, and plural.
-- Slugged option "slugField" is now "field"
+- Slugged option "slugField" is now "field", "multiSlug" has been removed for now as well as currencies.

+ 1 - 1
src/Model/Behavior/SluggedBehavior.php

@@ -74,7 +74,7 @@ class SluggedBehavior extends Behavior {
 		'encoding' => null,
 		'encoding' => null,
 		'scope' => array(),
 		'scope' => array(),
 		'tidy' => true,
 		'tidy' => true,
-		//'implementedFinders' => ['slugged' => 'findSlugged'],
+		'implementedFinders' => ['slugged' => 'findSlugged'],
 		//'implementedMethods' => ['slug' => 'slug']
 		//'implementedMethods' => ['slug' => 'slug']
 	);
 	);
 
 

+ 30 - 0
src/TestSuite/IntegrationTestCase.php

@@ -0,0 +1,30 @@
+<?php
+namespace Tools\TestSuite;
+
+use Cake\TestSuite\IntegrationTestCase as CakeIntegrationTestCase;
+use Cake\Routing\Router;
+
+/**
+ * Tools TestCase class
+ *
+ */
+abstract class IntegrationTestCase extends CakeIntegrationTestCase {
+
+	/**
+	 * Create a request object with the configured options and parameters.
+	 *
+	 * Overwrite to allow array URLs.
+	 *
+	 * @param string|array $url The URL
+	 * @param string $method The HTTP method
+	 * @param array|null $data The request data.
+	 * @return \Cake\Network\Request The built request.
+	 */
+	protected function _buildRequest($url, $method, $data) {
+		if (is_array($url)) {
+			$url = Router::url($url);
+		}
+		return parent::_buildRequest($url, $method, $data);
+	}
+
+}