1 | <?php |
||
23 | class ValidForeignKeyBehaviorTest extends CakeTestCase { |
||
24 | |||
25 | /** |
||
26 | * Model under test |
||
27 | * |
||
28 | * @var |
||
29 | */ |
||
30 | protected $_model; |
||
31 | |||
32 | /** |
||
33 | * Fixtures |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | public $fixtures = array( |
||
38 | 'plugin.valid_foreign_key.foreign_main', |
||
39 | 'plugin.valid_foreign_key.foreign_one', |
||
40 | 'plugin.valid_foreign_key.foreign_two', |
||
41 | ); |
||
42 | |||
43 | /** |
||
44 | * setUp method |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | public function setUp() { |
||
52 | |||
53 | /** |
||
54 | * tearDown method |
||
55 | * |
||
56 | * @return void |
||
57 | */ |
||
58 | public function tearDown() { |
||
63 | |||
64 | /** |
||
65 | * Tests the default config (no config given) |
||
66 | * |
||
67 | * @return void |
||
68 | * @coversNothing |
||
69 | */ |
||
70 | public function testDefaultConfig() { |
||
81 | |||
82 | /** |
||
83 | * Tests overwriting the default config. |
||
84 | * |
||
85 | * @return void |
||
86 | * @covers ::setup |
||
87 | */ |
||
88 | public function testOverwritingConfig() { |
||
105 | |||
106 | /** |
||
107 | * Tests overwriting the default config using the model name. |
||
108 | * |
||
109 | * @return void |
||
110 | * @covers ::setup |
||
111 | */ |
||
112 | public function testOverwritingConfigWithModelName() { |
||
136 | |||
137 | /** |
||
138 | * Tests that beforeValidate calls validateAllForeignKeys when autoValidate = true. |
||
139 | * |
||
140 | * @return void |
||
141 | * @covers ::beforeValidate |
||
142 | */ |
||
143 | public function testAutoValidateCallsMethod() { |
||
157 | |||
158 | /** |
||
159 | * Loads the behavior with the given config |
||
160 | * |
||
161 | * Specifically handles the case of setting no config at all. |
||
162 | * |
||
163 | * @param null|array $config Optional Behavior config to set. |
||
164 | * @return void |
||
165 | */ |
||
166 | protected function _loadBehavior($config = null) { |
||
173 | |||
174 | } |