ソースを参照

Merge pull request #79 from dereuromark/master-tests

fix tests
Mark 11 年 前
コミット
b5bb8783ec
46 ファイル変更190 行追加169 行削除
  1. 4 0
      .travis.yml
  2. 2 2
      Test/Case/Controller/Component/CommonComponentTest.php
  3. 6 0
      Test/Case/Model/Behavior/GeocoderBehaviorTest.php
  4. 15 15
      Test/Case/Model/Behavior/LogableBehaviorTest.php
  5. 3 0
      Test/Case/Model/Behavior/NamedScopeBehaviorTest.php
  6. 26 20
      Test/Case/Model/MyModelTest.php
  7. 3 0
      Test/Case/Model/SubqueryTest.php
  8. 15 15
      Test/Fixture/AddressFixture.php
  9. 1 1
      Test/Fixture/ArrayUserFixture.php
  10. 2 2
      Test/Fixture/BitmaskedCommentFixture.php
  11. 3 4
      Test/Fixture/CodeKeyFixture.php
  12. 12 12
      Test/Fixture/CountryFixture.php
  13. 3 3
      Test/Fixture/CountryProvinceFixture.php
  14. 3 3
      Test/Fixture/CustomDatumFixture.php
  15. 4 4
      Test/Fixture/DiscountCodeFixture.php
  16. 3 3
      Test/Fixture/DiscountFixture.php
  17. 3 3
      Test/Fixture/ExifFixture.php
  18. 3 3
      Test/Fixture/ImageFixture.php
  19. 3 3
      Test/Fixture/KeyValueFixture.php
  20. 3 3
      Test/Fixture/LocationFixture.php
  21. 3 3
      Test/Fixture/LogFixture.php
  22. 5 5
      Test/Fixture/LogIpFixture.php
  23. 4 4
      Test/Fixture/LogableLogFixture.php
  24. 2 2
      Test/Fixture/PingbackFixture.php
  25. 3 3
      Test/Fixture/PostFixture.php
  26. 3 3
      Test/Fixture/PostalCodeFixture.php
  27. 1 1
      Test/Fixture/QueuedTaskFixture.php
  28. 1 1
      Test/Fixture/QurlFixture.php
  29. 1 1
      Test/Fixture/RevisionArticleFixture.php
  30. 3 3
      Test/Fixture/RevisionArticlesRevFixture.php
  31. 2 2
      Test/Fixture/RevisionCommentsRevFixture.php
  32. 2 2
      Test/Fixture/RevisionCommentsRevisionTagFixture.php
  33. 4 4
      Test/Fixture/RevisionCommentsRevisionTagsRevFixture.php
  34. 2 2
      Test/Fixture/RevisionPostsRevFixture.php
  35. 2 2
      Test/Fixture/RevisionTagsRevFixture.php
  36. 1 1
      Test/Fixture/RevisionUserFixture.php
  37. 1 1
      Test/Fixture/RevisionVoteFixture.php
  38. 3 3
      Test/Fixture/RevisionVotesRevFixture.php
  39. 2 2
      Test/Fixture/RoleFixture.php
  40. 4 4
      Test/Fixture/SmsNotificationFixture.php
  41. 2 2
      Test/Fixture/TimeFixture.php
  42. 4 4
      Test/Fixture/TinyUrlFixture.php
  43. 3 3
      Test/Fixture/TokenFixture.php
  44. 1 1
      Test/Fixture/ToolsUserFixture.php
  45. 11 11
      Test/Fixture/TransactionFixture.php
  46. 3 3
      Test/Fixture/UserSettingFixture.php

+ 4 - 0
.travis.yml

@@ -21,6 +21,10 @@ matrix:
       env:
         - CAKE_VERSION=master
         - COVERALLS=1
+  fast_finish: true
+  allow_failures:
+    - env: DB=sqlite
+    - env: DB=pqsql
 
 before_script:
   - composer global require 'phpunit/phpunit=3.7.33'

+ 2 - 2
Test/Case/Controller/Component/CommonComponentTest.php

@@ -196,7 +196,7 @@ class CommonComponentTest extends CakeTestCase {
 		$this->assertTrue($is);
 
 		$res = CakeSession::read('Auth');
-		$this->assertSame($User->id, $res['User']['id']);
+		$this->assertEquals($User->id, $res['User']['id']);
 		$this->assertTrue(!empty($res['User']['Role']));
 	}
 
@@ -224,7 +224,7 @@ class CommonComponentTest extends CakeTestCase {
 		$this->assertTrue($is);
 
 		$res = CakeSession::read('Auth');
-		$this->assertSame($User->id, $res['User']['id']);
+		$this->assertEquals($User->id, $res['User']['id']);
 		$this->assertTrue(!empty($res['User']['Role']));
 	}
 

+ 6 - 0
Test/Case/Model/Behavior/GeocoderBehaviorTest.php

@@ -122,6 +122,9 @@ class GeocoderBehaviorTest extends MyCakeTestCase {
 		$is = $this->Comment->validateLongitude(-190);
 		$this->assertFalse($is);
 
+		$this->db = ConnectionManager::getDataSource('test');
+		$this->skipIf(!($this->db instanceof Mysql), 'The virtualFields test is only compatible with Mysql.');
+
 		$this->Comment->validator()->add('lat', 'validateLatitude', array('rule' => 'validateLatitude', 'message' => 'validateLatitudeError'));
 		$this->Comment->validator()->add('lng', 'validateLongitude', array('rule' => 'validateLongitude', 'message' => 'validateLongitudeError'));
 		$data = array(
@@ -143,6 +146,9 @@ class GeocoderBehaviorTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testBasic() {
+		$this->db = ConnectionManager::getDataSource('test');
+		$this->skipIf(!($this->db instanceof Mysql), 'The virtualFields test is only compatible with Mysql.');
+
 		$data = array(
 			'street' => 'Krebenweg 22',
 			'zip' => '74523',

+ 15 - 15
Test/Case/Model/Behavior/LogableBehaviorTest.php

@@ -219,7 +219,7 @@ class LogableBehaviorTest extends CakeTestCase {
 				'model' => 'LogableBook',
 				'foreign_id' => 5,
 				'action' => 'edit',
-				'user_id' => 0,
+				'user_id' => null,
 				'change' => 'title',
 			));
 		$this->assertEquals($expected, $result);
@@ -236,7 +236,7 @@ class LogableBehaviorTest extends CakeTestCase {
 				'model' => 'LogableBook',
 				'foreign_id' => 5,
 				'action' => 'delete',
-				'user_id' => 0,
+				'user_id' => null,
 				'change' => '',
 			));
 		$this->assertEquals($expected, $result);
@@ -253,7 +253,7 @@ class LogableBehaviorTest extends CakeTestCase {
 				'model' => 'LogableUser',
 				'foreign_id' => 302,
 				'action' => 'add',
-				'user_id' => 0,
+				'user_id' => null,
 				'change' => 'name',
 			)
 		);
@@ -269,7 +269,7 @@ class LogableBehaviorTest extends CakeTestCase {
 				'model' => 'LogableUser',
 				'foreign_id' => 302,
 				'action' => 'delete',
-				'user_id' => 0,
+				'user_id' => null,
 				'change' => '',
 			)
 		);
@@ -288,7 +288,7 @@ class LogableBehaviorTest extends CakeTestCase {
 				'model' => 'LogableComment',
 				'foreign_id' => 5,
 				'action' => 'add',
-				'user_id' => 0,
+				'user_id' => null,
 				'change' => 'content',
 			)
 		);
@@ -311,7 +311,7 @@ class LogableBehaviorTest extends CakeTestCase {
 				'model' => 'LogableBook',
 				'foreign_id' => (string)7,
 				'action' => 'add',
-				'user_id' => (string)0,
+				'user_id' => null,
 				'change' => 'title, weight',
 			)
 		);
@@ -330,7 +330,7 @@ class LogableBehaviorTest extends CakeTestCase {
 				'model' => 'LogableBook',
 				'foreign_id' => 5,
 				'action' => 'edit',
-				'user_id' => 0,
+				'user_id' => null,
 				'change' => 'title',
 			));
 
@@ -347,7 +347,7 @@ class LogableBehaviorTest extends CakeTestCase {
 				'model' => 'LogableBook',
 				'foreign_id' => 5,
 				'action' => 'delete',
-				'user_id' => 0,
+				'user_id' => null,
 				'change' => '',
 			));
 		$this->assertEquals($expected, $result);
@@ -371,9 +371,9 @@ class LogableBehaviorTest extends CakeTestCase {
 				//'description' => 'LogableBook "Denver" (7) added by System.',
 				'description' => '',
 				'model' => '',
-				'foreign_id' => '0',
+				'foreign_id' => null,
 				'action' => 'add',
-				'user_id' => (string)0,
+				'user_id' => null,
 				'change' => 'title',
 			)
 		);
@@ -388,9 +388,9 @@ class LogableBehaviorTest extends CakeTestCase {
 				//'description' => 'LogableBook "Forth book" (5) deleted by System.',
 				'description' => '',
 				'model' => '',
-				'foreign_id' => '0',
+				'foreign_id' => null,
 				'action' => 'delete',
-				'user_id' => 0,
+				'user_id' => null,
 				'change' => '',
 			));
 
@@ -413,7 +413,7 @@ class LogableBehaviorTest extends CakeTestCase {
 				'model' => 'LogableBook',
 				'foreign_id' => (string)7,
 				'action' => 'add',
-				'user_id' => '0',
+				'user_id' => null,
 				'change' => 'title',
 			)
 		);
@@ -470,7 +470,7 @@ class LogableBehaviorTest extends CakeTestCase {
 				'model' => 'LogableBook',
 				'foreign_id' => (string)5,
 				'action' => 'delete',
-				'user_id' => '0',
+				'user_id' => null,
 				'change' => '',
 			)
 		);
@@ -511,7 +511,7 @@ class LogableBehaviorTest extends CakeTestCase {
 				'model' => 'LogableBook',
 				'foreign_id' => '5',
 				'action' => 'delete',
-				'user_id' => '0',
+				'user_id' => null,
 				'change' => ''
 			)
 		);

+ 3 - 0
Test/Case/Model/Behavior/NamedScopeBehaviorTest.php

@@ -147,6 +147,9 @@ class NamedScopeBehaviorTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testScopedFindWithVirtualFields() {
+		$this->db = ConnectionManager::getDataSource('test');
+		$this->skipIf(!($this->db instanceof Mysql), 'The virtualFields test is only compatible with Mysql.');
+
 		$this->Comment->scopes = array('active' => array('Comment.published' => 'Y'));
 		$this->Comment->User->scopes = array('senior' => array('User.id <' => '2'));
 

+ 26 - 20
Test/Case/Model/MyModelTest.php

@@ -65,6 +65,9 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testGetFieldInUse() {
+		$this->db = ConnectionManager::getDataSource('test');
+		$this->skipIf(!($this->db instanceof Mysql), 'The test is only compatible with Mysql.');
+
 		$results = $this->Post->getFieldInUse('author_id', 'list');
 		$expected = array(1 => 'First Post', 2 => 'Second Post');
 		$this->assertEquals($expected, $results);
@@ -111,7 +114,9 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testGetNextAutoIncrement() {
-		$this->out($this->_header(__FUNCTION__), true);
+		$this->db = ConnectionManager::getDataSource('test');
+		$this->skipIf(!($this->db instanceof Mysql), 'The test is only compatible with Mysql.');
+
 		$is = $this->User->getNextAutoIncrement();
 		$this->out(returns($is));
 
@@ -143,6 +148,9 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testEscapeValue() {
+		$this->db = ConnectionManager::getDataSource('test');
+		$this->skipIf(!($this->db instanceof Mysql), 'The test is only compatible with Mysql.');
+
 		$res = $this->User->escapeValue(4);
 		$this->assertSame(4, $res);
 
@@ -281,31 +289,30 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testValidateRange() {
-		$this->out($this->_header(__FUNCTION__), true);
 		$is = $this->User->validateRange(array('range' => 2), 1, 3);
 		$this->assertTrue($is);
 
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$is = $this->User->validateRange(array('range' => 2.4), 1.5, 2.3);
 		$this->assertFalse($is);
 
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$is = $this->User->validateRange(array('range' => -5), -10, 1);
 		$this->assertTrue($is);
 
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$is = $this->User->validateRange(array('range' => 'word'), 1.5, 2.3);
 		$this->assertFalse($is);
 
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$is = $this->User->validateRange(array('range' => 5.1));
 		$this->assertTrue($is);
 
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$is = $this->User->validateRange(array('range' => 2.1), 2.1, 3.2);
 		$this->assertTrue($is);
 
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$is = $this->User->validateRange(array('range' => 3.2), 2.1, 3.2);
 		$this->assertTrue($is);
 	}
@@ -316,7 +323,6 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testValidateIdentical() {
-		$this->out($this->_header(__FUNCTION__), true);
 		$this->User->data = array($this->User->alias => array('y' => 'efg'));
 		$is = $this->User->validateIdentical(array('x' => 'efg'), 'y');
 		$this->assertTrue($is);
@@ -340,7 +346,7 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testValidateKey() {
-		$this->out($this->_header(__FUNCTION__), true);
+
 		//$this->User->data = array($this->User->alias=>array('y'=>'efg'));
 		$testModel = new AppTestModel();
 
@@ -390,7 +396,7 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testValidateEnum() {
-		$this->out($this->_header(__FUNCTION__), true);
+
 		//$this->User->data = array($this->User->alias=>array('y'=>'efg'));
 		$testModel = new AppTestModel();
 		$is = $testModel->validateEnum(array('x' => '1'), true);
@@ -412,7 +418,7 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testGuaranteeFields() {
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$res = $this->User->guaranteeFields(array());
 		//debug($res);
 		$this->assertTrue(empty($res));
@@ -467,7 +473,7 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testSet() {
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$data = array($this->modelName => array('x' => 'hey'), 'OtherModel' => array('y' => ''));
 		$this->User->data = array();
 
@@ -488,7 +494,7 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testValidateWithGuaranteeFields() {
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$data = array($this->modelName => array('x' => 'hey'), 'OtherModel' => array('y' => ''));
 
 		$data = $this->User->guaranteeFields(array('x', 'z'), $data);
@@ -547,7 +553,7 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testInvalidate() {
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$this->User->create();
 		$this->User->invalidate('fieldx', __('e %s f', 33));
 		$res = $this->User->validationErrors;
@@ -591,7 +597,7 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testValidateDate() {
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$data = array('field' => '2010-01-22');
 		$res = $this->User->validateDate($data);
 		//debug($res);
@@ -675,7 +681,7 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testValidateDatetime() {
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$data = array('field' => '2010-01-22 11:11:11');
 		$res = $this->User->validateDatetime($data);
 		//debug($res);
@@ -750,7 +756,7 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testValidateTime() {
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$data = array('field' => '11:21:11');
 		$res = $this->User->validateTime($data);
 		//debug($res);
@@ -780,7 +786,7 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testValidateUrl() {
-		$this->out($this->_header(__FUNCTION__), true);
+
 		$data = array('field' => 'www.dereuromark.de');
 		$res = $this->User->validateUrl($data, array('allowEmpty' => true));
 		$this->assertTrue($res);
@@ -844,7 +850,7 @@ class MyModelTest extends MyCakeTestCase {
 	 * @return void
 	 */
 	public function testValidateUnique() {
-		$this->out($this->_header(__FUNCTION__), true);
+
 
 		$this->Post->validate['title'] = array(
 			'validateUnique' => array(

+ 3 - 0
Test/Case/Model/SubqueryTest.php

@@ -16,6 +16,9 @@ class SubqueryTest extends MyCakeTestCase {
 	public function setUp() {
 		$this->Model = ClassRegistry::init('Country');
 
+		$this->db = ConnectionManager::getDataSource('test');
+		$this->skipIf(!($this->db instanceof Mysql), 'The subquery test is only compatible with Mysql.');
+
 		parent::setUp();
 	}
 

+ 15 - 15
Test/Fixture/AddressFixture.php

@@ -14,9 +14,9 @@ class AddressFixture extends CakeTestFixture {
 	 */
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary', 'collate' => null, 'comment' => ''),
-		'foreign_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'foreign_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'model' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'country_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 10, 'collate' => null, 'comment' => 'redundance purposely'),
+		'country_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10, 'collate' => null, 'comment' => 'redundance purposely'),
 		'first_name' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 50, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'last_name' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 50, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'street' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100, 'collate' => 'utf8_unicode_ci', 'comment' => 'street address and street numbe', 'charset' => 'utf8'),
@@ -24,11 +24,11 @@ class AddressFixture extends CakeTestFixture {
 		'city' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'lat' => array('type' => 'float', 'null' => false, 'default' => '0.000000', 'length' => '10,6', 'collate' => null, 'comment' => 'maps.google.de latitude'),
 		'lng' => array('type' => 'float', 'null' => false, 'default' => '0.000000', 'length' => '10,6', 'collate' => null, 'comment' => 'maps.google.de longitude'),
-		'last_used' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'last_used' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'formatted_address' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'type_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 4, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'type_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 4, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);
@@ -43,7 +43,7 @@ class AddressFixture extends CakeTestFixture {
 			'id' => '46',
 			'foreign_id' => '6',
 			'model' => 'Partner',
-			'country_id' => '0',
+			'country_id' => null,
 			'first_name' => 'Hans',
 			'last_name' => 'Wurst',
 			'street' => 'Langstrasse 10',
@@ -51,11 +51,11 @@ class AddressFixture extends CakeTestFixture {
 			'city' => 'München',
 			'lat' => '48.150589',
 			'lng' => '11.472230',
-			'last_used' => '0000-00-00 00:00:00',
+			'last_used' => null,
 			'formatted_address' => 'Josef-Lang-Straße 10, 81245 München, Deutschland',
 			'created' => '2011-04-21 16:50:05',
 			'modified' => '2011-10-07 17:42:27',
-			'type_id' => '0'
+			'type_id' => null
 		),
 		array(
 			'id' => '47',
@@ -73,13 +73,13 @@ class AddressFixture extends CakeTestFixture {
 			'formatted_address' => 'Eckermannstraße 10, 80689 München, Deutschland',
 			'created' => '2011-04-21 16:51:01',
 			'modified' => '2011-10-07 17:44:02',
-			'type_id' => '0'
+			'type_id' => null
 		),
 		array(
 			'id' => '48',
 			'foreign_id' => '7',
 			'model' => 'Partner',
-			'country_id' => '0',
+			'country_id' => null,
 			'first_name' => 'Tim',
 			'last_name' => 'Schoror',
 			'street' => 'Krebenweg 11',
@@ -87,11 +87,11 @@ class AddressFixture extends CakeTestFixture {
 			'city' => 'Schwäbisch Boll',
 			'lat' => '19.081490',
 			'lng' => '19.690800',
-			'last_used' => '0000-00-00 00:00:00',
+			'last_used' => null,
 			'formatted_address' => 'Krebenweg 11, 12523 Schwäbisch Boll, Deutschland',
 			'created' => '2011-11-17 13:47:36',
 			'modified' => '2011-11-17 13:47:36',
-			'type_id' => '0'
+			'type_id' => null
 		),
 		array(
 			'id' => '49',
@@ -105,11 +105,11 @@ class AddressFixture extends CakeTestFixture {
 			'city' => 'sdhfhj',
 			'lat' => '0.000000',
 			'lng' => '0.000000',
-			'last_used' => '0000-00-00 00:00:00',
+			'last_used' => null,
 			'formatted_address' => '',
 			'created' => '2011-11-17 14:34:14',
 			'modified' => '2011-11-17 14:49:21',
-			'type_id' => '0'
+			'type_id' => null
 		),
 	);
 }

+ 1 - 1
Test/Fixture/ArrayUserFixture.php

@@ -29,7 +29,7 @@ class ArrayUserFixture extends CakeTestFixture {
 	 */
 	public $fields = array(
 		'id' => array('type' => 'integer', 'key' => 'primary'),
-		'born_id' => array('type' => 'integer', 'null' => false),
+		'born_id' => array('type' => 'integer', 'null' => true),
 		'name' => array('type' => 'string', 'null' => false)
 	);
 

+ 2 - 2
Test/Fixture/BitmaskedCommentFixture.php

@@ -12,8 +12,8 @@ class BitmaskedCommentFixture extends CakeTestFixture {
 	 */
 	public $fields = array(
 		'id' => array('type' => 'integer', 'key' => 'primary'),
-		'article_id' => array('type' => 'integer', 'null' => false),
-		'user_id' => array('type' => 'integer', 'null' => false),
+		'article_id' => array('type' => 'integer', 'null' => true),
+		'user_id' => array('type' => 'integer', 'null' => true),
 		'comment' => 'text',
 		'status' => array('type' => 'integer', 'null' => false, 'length' => 2, 'default' => '0'),
 		'created' => 'datetime',

+ 3 - 4
Test/Fixture/CodeKeyFixture.php

@@ -1,5 +1,4 @@
 <?php
-/* CodeKey Fixture generated on: 2011-11-20 21:58:47 : 1321822727 */
 
 /**
  * CodeKeyFixture
@@ -14,13 +13,13 @@ class CodeKeyFixture extends CakeTestFixture {
 	 */
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary', 'collate' => null, 'comment' => ''),
-		'user_id' => array('type' => 'string', 'null' => false, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'user_id' => array('type' => 'string', 'null' => true, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'type' => array('type' => 'string', 'null' => false, 'length' => 10, 'collate' => 'utf8_unicode_ci', 'comment' => 'e.g.:activate,reactivate', 'charset' => 'utf8'),
 		'key' => array('type' => 'string', 'null' => false, 'length' => 60, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'content' => array('type' => 'string', 'null' => false, 'collate' => 'utf8_unicode_ci', 'comment' => 'can transport some information', 'charset' => 'utf8'),
 		'used' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'collate' => null, 'comment' => ''),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);

+ 12 - 12
Test/Fixture/CountryFixture.php

@@ -18,7 +18,7 @@ class CountryFixture extends CakeTestFixture {
 		'ori_name' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 64, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'iso2' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 2, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'iso3' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 3, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'continent_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 10, 'collate' => null, 'comment' => ''),
+		'continent_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10, 'collate' => null, 'comment' => ''),
 		'country_code' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 4, 'collate' => null, 'comment' => ''),
 		'eu_member' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'collate' => null, 'comment' => 'Member of the EU'),
 		'special' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 40, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
@@ -29,7 +29,7 @@ class CountryFixture extends CakeTestFixture {
 		'lng' => array('type' => 'float', 'null' => false, 'default' => '0.000000', 'length' => '10,6', 'collate' => null, 'comment' => 'forGoogleMap'),
 		'address_format' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'status' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 2, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);
@@ -46,7 +46,7 @@ class CountryFixture extends CakeTestFixture {
 			'ori_name' => 'Deutschland',
 			'iso2' => 'DE',
 			'iso3' => 'DEU',
-			'continent_id' => '0',
+			'continent_id' => null,
 			'country_code' => '49',
 			'eu_member' => 1,
 			'special' => '',
@@ -65,7 +65,7 @@ class CountryFixture extends CakeTestFixture {
 			'ori_name' => 'Österreich',
 			'iso2' => 'AT',
 			'iso3' => 'AUT',
-			'continent_id' => '0',
+			'continent_id' => null,
 			'country_code' => '43',
 			'eu_member' => 1,
 			'special' => '',
@@ -84,7 +84,7 @@ class CountryFixture extends CakeTestFixture {
 			'ori_name' => 'Schweiz',
 			'iso2' => 'CH',
 			'iso3' => 'CHE',
-			'continent_id' => '0',
+			'continent_id' => null,
 			'country_code' => '41',
 			'eu_member' => 0,
 			'special' => '',
@@ -103,7 +103,7 @@ class CountryFixture extends CakeTestFixture {
 			'ori_name' => 'Belgium',
 			'iso2' => 'BE',
 			'iso3' => 'BEL',
-			'continent_id' => '0',
+			'continent_id' => null,
 			'country_code' => '32',
 			'eu_member' => 1,
 			'special' => '',
@@ -122,7 +122,7 @@ class CountryFixture extends CakeTestFixture {
 			'ori_name' => 'Netherlands',
 			'iso2' => 'NL',
 			'iso3' => 'NLD',
-			'continent_id' => '0',
+			'continent_id' => null,
 			'country_code' => '31',
 			'eu_member' => 1,
 			'special' => '',
@@ -141,7 +141,7 @@ class CountryFixture extends CakeTestFixture {
 			'ori_name' => 'Denmark',
 			'iso2' => 'DK',
 			'iso3' => 'DNK',
-			'continent_id' => '0',
+			'continent_id' => null,
 			'country_code' => '45',
 			'eu_member' => 1,
 			'special' => '',
@@ -160,7 +160,7 @@ class CountryFixture extends CakeTestFixture {
 			'ori_name' => 'Luxembourg',
 			'iso2' => 'LU',
 			'iso3' => 'LUX',
-			'continent_id' => '0',
+			'continent_id' => null,
 			'country_code' => '352',
 			'eu_member' => 1,
 			'special' => '',
@@ -179,7 +179,7 @@ class CountryFixture extends CakeTestFixture {
 			'ori_name' => 'France',
 			'iso2' => 'FR',
 			'iso3' => 'FRA',
-			'continent_id' => '0',
+			'continent_id' => null,
 			'country_code' => '33',
 			'eu_member' => 1,
 			'special' => '',
@@ -198,7 +198,7 @@ class CountryFixture extends CakeTestFixture {
 			'ori_name' => 'United Kingdom (Great Britian)',
 			'iso2' => 'GB',
 			'iso3' => 'GBR',
-			'continent_id' => '0',
+			'continent_id' => null,
 			'country_code' => '44',
 			'eu_member' => 1,
 			'special' => '',
@@ -217,7 +217,7 @@ class CountryFixture extends CakeTestFixture {
 			'ori_name' => 'Ukraine',
 			'iso2' => 'UA',
 			'iso3' => 'UKR',
-			'continent_id' => '0',
+			'continent_id' => null,
 			'country_code' => '380',
 			'eu_member' => 1,
 			'special' => '',

+ 3 - 3
Test/Fixture/CountryProvinceFixture.php

@@ -14,12 +14,12 @@ class CountryProvinceFixture extends CakeTestFixture {
 	 */
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary', 'collate' => null, 'comment' => ''),
-		'country_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 10, 'collate' => null, 'comment' => ''),
+		'country_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10, 'collate' => null, 'comment' => ''),
 		'abbr' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 3, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'name' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 40, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'lat' => array('type' => 'float', 'null' => false, 'default' => '0.000000', 'length' => '10,6', 'collate' => null, 'comment' => ''),
 		'lng' => array('type' => 'float', 'null' => false, 'default' => '0.000000', 'length' => '10,6', 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);
@@ -100,7 +100,7 @@ class CountryProvinceFixture extends CakeTestFixture {
 			'name' => 'Mecklenburg-Vorp.',
 			'lat' => '0.000000',
 			'lng' => '0.000000',
-			'modified' => '0000-00-00 00:00:00'
+			'modified' => null
 		),
 		array(
 			'id' => '9',

+ 3 - 3
Test/Fixture/CustomDatumFixture.php

@@ -14,12 +14,12 @@ class CustomDatumFixture extends CakeTestFixture {
 	 */
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary', 'collate' => null, 'comment' => ''),
-		'foreign_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'foreign_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'model' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'key' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'value' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_unicode_ci', 'engine' => 'MyISAM')
 	);

+ 4 - 4
Test/Fixture/DiscountCodeFixture.php

@@ -14,13 +14,13 @@ class DiscountCodeFixture extends CakeTestFixture {
 	 */
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary', 'collate' => null, 'comment' => ''),
-		'discount_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 10, 'collate' => null, 'comment' => ''),
+		'discount_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10, 'collate' => null, 'comment' => ''),
 		'code' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 20, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'used' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'collate' => null, 'comment' => ''),
 		'model' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'foreign_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'foreign_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);

+ 3 - 3
Test/Fixture/DiscountFixture.php

@@ -22,10 +22,10 @@ class DiscountFixture extends CakeTestFixture {
 		'valid_from' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'valid_until' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'model' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 20, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'foreign_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'foreign_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'details' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => 'json encoded!', 'charset' => 'utf8'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);

+ 3 - 3
Test/Fixture/ExifFixture.php

@@ -4,11 +4,11 @@ class ExifFixture extends CakeTestFixture {
 
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
-		'user_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'key' => 'index'),
+		'user_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'key' => 'index'),
 		'title' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30),
 		'body' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 255),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'user_id' => array('column' => 'user_id', 'unique' => 0)),
 		'tableParameters' => array()
 	);

+ 3 - 3
Test/Fixture/ImageFixture.php

@@ -19,9 +19,9 @@ class ImageFixture extends CakeTestFixture {
 		'is_master' => array('type' => 'boolean', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
 		'filename' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'model' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'foreign_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'foreign_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);

+ 3 - 3
Test/Fixture/KeyValueFixture.php

@@ -12,11 +12,11 @@ class KeyValueFixture extends CakeTestFixture {
 	 */
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
-		'foreign_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'key' => 'index', 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
+		'foreign_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'key' => 'index', 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
 		'key' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
 		'value' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => 'option setting', 'charset' => 'utf8'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null),
 		'indexes' => array(
 			'PRIMARY' => array('column' => 'id', 'unique' => 1),
 			'foreign_id' => array('column' => 'foreign_id', 'unique' => 0)

+ 3 - 3
Test/Fixture/LocationFixture.php

@@ -15,14 +15,14 @@ class LocationFixture extends CakeTestFixture {
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary', 'collate' => null, 'comment' => ''),
 		'name' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 50, 'collate' => 'utf8_general_ci', 'comment' => '', 'charset' => 'utf8'),
-		'country_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 10, 'collate' => null, 'comment' => ''),
+		'country_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10, 'collate' => null, 'comment' => ''),
 		'lat' => array('type' => 'float', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
 		'lng' => array('type' => 'float', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
 		'formatted_address' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'locality' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 50, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'sublocality' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 50, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);

+ 3 - 3
Test/Fixture/LogFixture.php

@@ -19,9 +19,9 @@ class LogFixture extends CakeTestFixture {
 		'model' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 40, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'foreign_key' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'action' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 40, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'user_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'user_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);

+ 5 - 5
Test/Fixture/LogIpFixture.php

@@ -18,11 +18,11 @@ class LogIpFixture extends CakeTestFixture {
 		'referer' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'host' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 128, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'agent' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => 'browser', 'charset' => 'utf8'),
-		'user_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'key' => 'index', 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'user_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'key' => 'index', 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'lat' => array('type' => 'float', 'null' => false, 'default' => '0.000000', 'length' => '10,6', 'collate' => null, 'comment' => ''),
 		'lng' => array('type' => 'float', 'null' => false, 'default' => '0.000000', 'length' => '10,6', 'collate' => null, 'comment' => ''),
 		'city' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 60, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => 'each ip is only valid for a few hours'),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => 'each ip is only valid for a few hours'),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'user_id' => array('column' => 'user_id', 'unique' => 0), 'ip' => array('column' => 'ip', 'unique' => 0)),
 		'tableParameters' => array()
 	);
@@ -39,7 +39,7 @@ class LogIpFixture extends CakeTestFixture {
 			'referer' => '',
 			'host' => 'marknb',
 			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30',
-			'user_id' => '0',
+			'user_id' => null,
 			'lat' => '0.000000',
 			'lng' => '0.000000',
 			'city' => '',
@@ -51,7 +51,7 @@ class LogIpFixture extends CakeTestFixture {
 			'referer' => '',
 			'host' => 'marknb',
 			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30',
-			'user_id' => '0',
+			'user_id' => null,
 			'lat' => '0.000000',
 			'lng' => '0.000000',
 			'city' => '',
@@ -63,7 +63,7 @@ class LogIpFixture extends CakeTestFixture {
 			'referer' => '',
 			'host' => 'marknb',
 			'agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30',
-			'user_id' => '0',
+			'user_id' => null,
 			'lat' => '0.000000',
 			'lng' => '0.000000',
 			'city' => '',

+ 4 - 4
Test/Fixture/LogableLogFixture.php

@@ -16,18 +16,18 @@ class LogableLogFixture extends CakeTestFixture {
 			'type' => 'string',
 			'length' => 255,
 			'null' => false),
-		'foreign_id' => array('type' => 'integer', 'null' => false),
+		'foreign_id' => array('type' => 'integer', 'null' => true),
 		'action' => array(
 			'type' => 'string',
 			'length' => 25,
 			'null' => false),
-		'user_id' => array('type' => 'integer', 'null' => false),
+		'user_id' => array('type' => 'integer', 'null' => true),
 		'change' => array(
 			'type' => 'string',
 			'length' => 255,
 			'null' => false),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);

+ 2 - 2
Test/Fixture/PingbackFixture.php

@@ -4,14 +4,14 @@ class PingbackFixture extends CakeTestFixture {
 
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
-		'foreign_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
+		'foreign_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
 		'model' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
 		'title' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
 		'url' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
 		'ip' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 60, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
 		'host' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
 		'status' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 2, 'comment' => 'approved etc'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);

+ 3 - 3
Test/Fixture/PostFixture.php

@@ -16,12 +16,12 @@ class PostFixture extends CakeTestFixture {
 		'slug' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
 		'markup' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 2),
 		'content' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
-		'foreign_key' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 10),
+		'foreign_key' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 10),
 		'model' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
 		'created_by' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
 		'modified_by' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'charset' => 'utf8'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_unicode_ci', 'engine' => 'MyISAM')
 	);

+ 3 - 3
Test/Fixture/PostalCodeFixture.php

@@ -15,12 +15,12 @@ class PostalCodeFixture extends CakeTestFixture {
 	public $fields = array(
 		'id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'key' => 'primary', 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'code' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 5, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'country_id' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 2, 'collate' => null, 'comment' => ''),
+		'country_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 2, 'collate' => null, 'comment' => ''),
 		'lat' => array('type' => 'float', 'null' => false, 'default' => '0.0000', 'length' => '9,4', 'collate' => null, 'comment' => ''),
 		'lng' => array('type' => 'float', 'null' => false, 'default' => '0.0000', 'length' => '9,4', 'collate' => null, 'comment' => ''),
 		'official_address' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);

+ 1 - 1
Test/Fixture/QueuedTaskFixture.php

@@ -18,7 +18,7 @@ class QueuedTaskFixture extends CakeTestFixture {
 		'data' => array('type' => 'text', 'null' => true, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'group' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'reference' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'notbefore' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'fetched' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'completed' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),

+ 1 - 1
Test/Fixture/QurlFixture.php

@@ -21,7 +21,7 @@ class QurlFixture extends CakeTestFixture {
 		'used' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 10),
 		'last_used' => array('type' => 'datetime', 'null' => true, 'default' => null),
 		'active' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null),
 		'indexes' => array(
 			'PRIMARY' => array('column' => 'id', 'unique' => 1)
 		),

+ 1 - 1
Test/Fixture/RevisionArticleFixture.php

@@ -7,7 +7,7 @@ class RevisionArticleFixture extends CakeTestFixture {
 					'null' => false,
 					'default' => null,
 					'key' => 'primary'),
-			'user_id' => array('type' => 'integer', 'null' => false, 'default' => null),
+			'user_id' => array('type' => 'integer', 'null' => true, 'default' => null),
 			'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null),
 			'lft' => array('type' => 'integer', 'null' => true, 'default' => null),
 			'rght' => array('type' => 'integer', 'null' => true, 'default' => null),

+ 3 - 3
Test/Fixture/RevisionArticlesRevFixture.php

@@ -2,10 +2,10 @@
 class RevisionArticlesRevFixture extends CakeTestFixture {
 
 	public $fields = array(
-			'version_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'),
-			'version_created' => array('type' => 'datetime', 'null' => false, 'default' => null),
+			'version_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'key' => 'primary'),
+			'version_created' => array('type' => 'datetime', 'null' => true, 'default' => null),
 			'id' => array('type' => 'integer', 'null' => false, 'default' => null),
-			'user_id' => array('type' => 'integer', 'null' => false, 'default' => null),
+			'user_id' => array('type' => 'integer', 'null' => true, 'default' => null),
 			'parent_id' => array('type' => 'integer', 'null' => true, 'default' => null),
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),

+ 2 - 2
Test/Fixture/RevisionCommentsRevFixture.php

@@ -2,8 +2,8 @@
 class RevisionCommentsRevFixture extends CakeTestFixture {
 
 	public $fields = array(
-			'version_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'),
-			'version_created' => array('type' => 'datetime', 'null' => false, 'default' => null),
+			'version_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'key' => 'primary'),
+			'version_created' => array('type' => 'datetime', 'null' => true, 'default' => null),
 			'id' => array(
 					'type' => 'integer',
 					'null' => false,

+ 2 - 2
Test/Fixture/RevisionCommentsRevisionTagFixture.php

@@ -7,8 +7,8 @@ class RevisionCommentsRevisionTagFixture extends CakeTestFixture {
 					'null' => false,
 					'default' => null,
 					'key' => 'primary'),
-			'revision_comment_id' => array('type' => 'integer', 'null' => false),
-			'revision_tag_id' => array('type' => 'integer', 'null' => false),
+			'revision_comment_id' => array('type' => 'integer', 'null' => true),
+			'revision_tag_id' => array('type' => 'integer', 'null' => true),
 			'indexes' => array('PRIMARY' => array('column' => 'id')));
 
 	public $records = array(

+ 4 - 4
Test/Fixture/RevisionCommentsRevisionTagsRevFixture.php

@@ -2,11 +2,11 @@
 class RevisionCommentsRevisionTagsRevFixture extends CakeTestFixture {
 
 	public $fields = array(
-			'version_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'),
-			'version_created' => array('type' => 'datetime', 'null' => false, 'default' => null),
+			'version_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'key' => 'primary'),
+			'version_created' => array('type' => 'datetime', 'null' => true, 'default' => null),
 			'id' => array('type' => 'integer', 'null' => false),
-			'revision_comment_id' => array('type' => 'integer', 'null' => false),
-			'revision_tag_id' => array('type' => 'integer', 'null' => false),
+			'revision_comment_id' => array('type' => 'integer', 'null' => true),
+			'revision_tag_id' => array('type' => 'integer', 'null' => true),
 			'indexes' => array('PRIMARY' => array('column' => 'version_id')));
 
 	public $records = array(

+ 2 - 2
Test/Fixture/RevisionPostsRevFixture.php

@@ -2,8 +2,8 @@
 class RevisionPostsRevFixture extends CakeTestFixture {
 
 	public $fields = array(
-			'version_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'),
-			'version_created' => array('type' => 'datetime', 'null' => false, 'default' => null),
+			'version_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'key' => 'primary'),
+			'version_created' => array('type' => 'datetime', 'null' => true, 'default' => null),
 			'id' => array('type' => 'integer', 'null' => false, 'default' => null),
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null));

+ 2 - 2
Test/Fixture/RevisionTagsRevFixture.php

@@ -3,8 +3,8 @@
 class RevisionTagsRevFixture extends CakeTestFixture {
 
 	public $fields = array(
-			'version_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'),
-			'version_created' => array('type' => 'datetime', 'null' => false, 'default' => null),
+			'version_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'key' => 'primary'),
+			'version_created' => array('type' => 'datetime', 'null' => true, 'default' => null),
 			'id' => array('type' => 'integer', 'null' => false, 'default' => null),
 			'title' => array('type' => 'string', 'null' => false, 'default' => null)
 	);

+ 1 - 1
Test/Fixture/RevisionUserFixture.php

@@ -5,7 +5,7 @@ class RevisionUserFixture extends CakeTestFixture {
 			'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'),
 			'name' => array('type' => 'string', 'null' => false, 'default' => null),
 			'username' => array('type' => 'string', 'null' => false, 'default' => null),
-			'created' => array('type' => 'date', 'null' => false, 'default' => null),
+			'created' => array('type' => 'date', 'null' => true, 'default' => null),
 			'indexes' => array('PRIMARY' => array('column' => 'id'))
 			);
 

+ 1 - 1
Test/Fixture/RevisionVoteFixture.php

@@ -10,7 +10,7 @@ class RevisionVoteFixture extends CakeTestFixture {
 					'key' => 'primary'),
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),
-			'revision_comment_id' => array('type' => 'integer', 'null' => false),
+			'revision_comment_id' => array('type' => 'integer', 'null' => true),
 			'indexes' => array('PRIMARY' => array('column' => 'id')));
 
 	public $records = array(

+ 3 - 3
Test/Fixture/RevisionVotesRevFixture.php

@@ -2,15 +2,15 @@
 class RevisionVotesRevFixture extends CakeTestFixture {
 
 	public $fields = array(
-			'version_id' => array('type' => 'integer', 'null' => false, 'default' => null, 'key' => 'primary'),
-			'version_created' => array('type' => 'datetime', 'null' => false, 'default' => null),
+			'version_id' => array('type' => 'integer', 'null' => true, 'default' => null, 'key' => 'primary'),
+			'version_created' => array('type' => 'datetime', 'null' => true, 'default' => null),
 			'id' => array(
 					'type' => 'integer',
 					'null' => false,
 					'default' => null),
 			'title' => array('type' => 'string', 'null' => false, 'default' => null),
 			'content' => array('type' => 'text', 'null' => false, 'default' => null),
-			'revision_comment_id' => array('type' => 'integer', 'null' => false));
+			'revision_comment_id' => array('type' => 'integer', 'null' => true));
 
 	public $records = array(
 		array(

+ 2 - 2
Test/Fixture/RoleFixture.php

@@ -17,8 +17,8 @@ class RoleFixture extends CakeTestFixture {
 		'description' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'alias' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 20, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'default_role' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'collate' => null, 'comment' => 'set at register'),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'sort' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 10, 'collate' => null, 'comment' => ''),
 		'active' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),

+ 4 - 4
Test/Fixture/SmsNotificationFixture.php

@@ -14,15 +14,15 @@ class SmsNotificationFixture extends CakeTestFixture {
 	 */
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary', 'collate' => null, 'comment' => ''),
-		'status_id' => array('type' => 'string', 'null' => false, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'status_id' => array('type' => 'string', 'null' => true, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'type' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 2, 'collate' => null, 'comment' => '0=answer,1=status'),
 		'answer' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'number' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'sender' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'status' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 2, 'collate' => null, 'comment' => ''),
-		'time' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'time' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);

+ 2 - 2
Test/Fixture/TimeFixture.php

@@ -21,8 +21,8 @@ class TimeFixture extends CakeTestFixture {
 		'description' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'price' => array('type' => 'float', 'null' => false, 'default' => null, 'length' => '8,2', 'collate' => null, 'comment' => ''),
 		'price_premium' => array('type' => 'float', 'null' => false, 'default' => null, 'length' => '8,2', 'collate' => null, 'comment' => ''),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);

+ 4 - 4
Test/Fixture/TinyUrlFixture.php

@@ -12,15 +12,15 @@ class TinyUrlFixture extends CakeTestFixture {
 	 */
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary', 'collate' => null, 'comment' => ''),
-		'user_id' => array('type' => 'string', 'null' => false, 'length' => 36, 'key' => 'index', 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'user_id' => array('type' => 'string', 'null' => true, 'length' => 36, 'key' => 'index', 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'model' => array('type' => 'string', 'null' => false, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'foreign_id' => array('type' => 'string', 'null' => false, 'length' => 36, 'key' => 'index', 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'foreign_id' => array('type' => 'string', 'null' => true, 'length' => 36, 'key' => 'index', 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'url' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => 'for external urls', 'charset' => 'utf8'),
 		'content' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => 'can transport some information', 'charset' => 'utf8'),
 		'used' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 10, 'collate' => null, 'comment' => ''),
 		'last_used' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'user_id' => array('column' => 'user_id', 'unique' => 0), 'foreign_id' => array('column' => 'foreign_id', 'unique' => 0)),
 		'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_unicode_ci', 'engine' => 'MyISAM')
 	);

+ 3 - 3
Test/Fixture/TokenFixture.php

@@ -14,13 +14,13 @@ class TokenFixture extends CakeTestFixture {
 	 */
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary', 'collate' => null, 'comment' => ''),
-		'user_id' => array('type' => 'string', 'null' => false, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'user_id' => array('type' => 'string', 'null' => true, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'type' => array('type' => 'string', 'null' => false, 'length' => 10, 'collate' => 'utf8_unicode_ci', 'comment' => 'e.g.:activate,reactivate', 'charset' => 'utf8'),
 		'key' => array('type' => 'string', 'null' => false, 'length' => 60, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'content' => array('type' => 'string', 'null' => false, 'collate' => 'utf8_unicode_ci', 'comment' => 'can transport some information', 'charset' => 'utf8'),
 		'used' => array('type' => 'boolean', 'null' => false, 'default' => '0', 'collate' => null, 'comment' => ''),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);

+ 1 - 1
Test/Fixture/ToolsUserFixture.php

@@ -14,7 +14,7 @@ class ToolsUserFixture extends CakeTestFixture {
 		'id' => array('type' => 'integer', 'key' => 'primary'),
 		'name' => array('type' => 'string', 'null' => false),
 		'password' => array('type' => 'string', 'null' => false),
-		'role_id' => array('type' => 'integer', 'null' => false),
+		'role_id' => array('type' => 'integer', 'null' => true),
 	);
 
 	/**

+ 11 - 11
Test/Fixture/TransactionFixture.php

@@ -16,10 +16,10 @@ class TransactionFixture extends CakeTestFixture {
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary', 'collate' => null, 'comment' => ''),
 		'title' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'token' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'foreign_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'foreign_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'model' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'type' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => 'paypal, ...', 'charset' => 'utf8'),
-		'transaction_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
+		'transaction_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 100, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'transaction_type' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'note' => array('type' => 'string', 'null' => false, 'default' => null, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'amount' => array('type' => 'float', 'null' => false, 'default' => '0.00', 'length' => '9,2', 'collate' => null, 'comment' => ''),
@@ -30,8 +30,8 @@ class TransactionFixture extends CakeTestFixture {
 		'payment_status' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'pending_reason' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 100, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
 		'reason_code' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30, 'collate' => 'utf8_unicode_ci', 'comment' => '', 'charset' => 'utf8'),
-		'order_time' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null, 'collate' => null, 'comment' => ''),
+		'order_time' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null, 'collate' => null, 'comment' => ''),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
 		'tableParameters' => array()
 	);
@@ -60,7 +60,7 @@ class TransactionFixture extends CakeTestFixture {
 			'payment_status' => '',
 			'pending_reason' => '',
 			'reason_code' => '',
-			'order_time' => '0000-00-00 00:00:00',
+			'order_time' => null,
 			'created' => '2011-09-23 14:58:38'
 		),
 		array(
@@ -81,7 +81,7 @@ class TransactionFixture extends CakeTestFixture {
 			'payment_status' => '',
 			'pending_reason' => '',
 			'reason_code' => '',
-			'order_time' => '0000-00-00 00:00:00',
+			'order_time' => null,
 			'created' => '2011-09-23 15:19:42'
 		),
 		array(
@@ -102,7 +102,7 @@ class TransactionFixture extends CakeTestFixture {
 			'payment_status' => '',
 			'pending_reason' => '',
 			'reason_code' => '',
-			'order_time' => '0000-00-00 00:00:00',
+			'order_time' => null,
 			'created' => '2011-09-23 17:13:59'
 		),
 		array(
@@ -123,7 +123,7 @@ class TransactionFixture extends CakeTestFixture {
 			'payment_status' => '',
 			'pending_reason' => '',
 			'reason_code' => '',
-			'order_time' => '0000-00-00 00:00:00',
+			'order_time' => null,
 			'created' => '2011-09-23 17:07:40'
 		),
 		array(
@@ -207,7 +207,7 @@ class TransactionFixture extends CakeTestFixture {
 			'payment_status' => '',
 			'pending_reason' => '',
 			'reason_code' => '',
-			'order_time' => '0000-00-00 00:00:00',
+			'order_time' => null,
 			'created' => '2011-09-29 23:40:48'
 		),
 		array(
@@ -228,7 +228,7 @@ class TransactionFixture extends CakeTestFixture {
 			'payment_status' => '',
 			'pending_reason' => '',
 			'reason_code' => '',
-			'order_time' => '0000-00-00 00:00:00',
+			'order_time' => null,
 			'created' => '2011-10-03 16:35:08'
 		),
 		array(
@@ -249,7 +249,7 @@ class TransactionFixture extends CakeTestFixture {
 			'payment_status' => '',
 			'pending_reason' => '',
 			'reason_code' => '',
-			'order_time' => '0000-00-00 00:00:00',
+			'order_time' => null,
 			'created' => '2011-10-27 02:58:50'
 		),
 	);

+ 3 - 3
Test/Fixture/UserSettingFixture.php

@@ -4,11 +4,11 @@ class UserSettingFixture extends CakeTestFixture {
 
 	public $fields = array(
 		'id' => array('type' => 'integer', 'null' => false, 'default' => null, 'length' => 10, 'key' => 'primary'),
-		'user_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'key' => 'index'),
+		'user_id' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 36, 'key' => 'index'),
 		'key' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 30),
 		'value' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 255),
-		'created' => array('type' => 'datetime', 'null' => false, 'default' => null),
-		'modified' => array('type' => 'datetime', 'null' => false, 'default' => null),
+		'created' => array('type' => 'datetime', 'null' => true, 'default' => null),
+		'modified' => array('type' => 'datetime', 'null' => true, 'default' => null),
 		'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'user_id' => array('column' => 'user_id', 'unique' => 0)),
 		'tableParameters' => array()
 	);