euromark 11 years ago
parent
commit
0cf9290096
2 changed files with 24 additions and 14 deletions
  1. 22 12
      docs/Shims.md
  2. 2 2
      tests/TestCase/Model/Behavior/PasswordableBehaviorTest.php

+ 22 - 12
docs/Shims.md

@@ -1,6 +1,27 @@
 # Migration from 2.x to 3.x: Shims
+Shims ease migration as complete parts of the code, such as validation and other model property settings
+can be reused immediatelly without refactoring them right away.
 
-## Session
+Note: It does not hurt to have them, if you don't use them. The overhead is minimal.
+
+## Model
+The following can be used in 3.x via shim support:
+
+### Table
+- $order property
+- $validate property
+- relations (hasX, belongsTo)
+- $displayField
+- $primaryKey
+- Timestamp behavior added by default (if modified or created exists)
+
+### Entity
+- Enums via enum() are ported in entity, if you used them before.
+
+
+## Component
+
+### Session
 The session component of the core is deprecated and will throw a warning as it will soon be removed.
 Better use the plugin one right away. It is a 1:1 clone of it.
 ```php
@@ -15,14 +36,3 @@ class AppController extends Controller {
 }
 ```
 It also contains the new consume() method.
-
-## Model
-The following can be used in 3.x via shim support:
-
-### Used to be on models => now on tables
-- $order property
-- $validate property
-- relations (hasX, belongsTo)
-- $displayField
-- $primaryKey
-- Timestamp behavior added by default (if modified or created exists)

+ 2 - 2
tests/TestCase/Model/Behavior/PasswordableBehaviorTest.php

@@ -148,7 +148,7 @@ class PasswordableBehaviorTest extends TestCase {
 		$this->Users->patchEntity($user, $data);
 		$is = $this->Users->save($user);
 		$this->assertTrue((bool)$is);
-		$this->assertEquals(array('name', 'created', 'modified', 'id'), $is->visibleProperties());
+		$this->assertEquals(array('name', 'id'), $is->visibleProperties());
 
 		$id = $user->id;
 		$user = $this->Users->newEntity();
@@ -160,7 +160,7 @@ class PasswordableBehaviorTest extends TestCase {
 		$this->Users->patchEntity($user, $data);
 		$is = $this->Users->save($user);
 		$this->assertTrue((bool)$is);
-		$this->assertEquals(array('id', 'modified'), $is->visibleProperties());
+		$this->assertEquals(array('id'), $is->visibleProperties());
 	}
 
 	/**