Skip to content

Commit 98f03dc

Browse files
shamamarkstory
authored andcommitted
Replacing test case compatibility functions
1 parent 2c5350b commit 98f03dc

File tree

107 files changed

+6361
-6361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+6361
-6361
lines changed

lib/Cake/Test/Case/BasicsTest.php

Lines changed: 104 additions & 104 deletions
Large diffs are not rendered by default.

lib/Cake/Test/Case/Cache/CacheTest.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function tearDown() {
5757
public function testConfig() {
5858
$settings = array('engine' => 'File', 'path' => TMP . 'tests', 'prefix' => 'cake_test_');
5959
$results = Cache::config('new', $settings);
60-
$this->assertEqual($results, Cache::config('new'));
60+
$this->assertEquals($results, Cache::config('new'));
6161
$this->assertTrue(isset($results['engine']));
6262
$this->assertTrue(isset($results['settings']));
6363
}
@@ -93,11 +93,11 @@ public function testConfigWithLibAndPluginEngines() {
9393

9494
$settings = array('engine' => 'TestAppCache', 'path' => TMP, 'prefix' => 'cake_test_');
9595
$result = Cache::config('libEngine', $settings);
96-
$this->assertEqual($result, Cache::config('libEngine'));
96+
$this->assertEquals($result, Cache::config('libEngine'));
9797

9898
$settings = array('engine' => 'TestPlugin.TestPluginCache', 'path' => TMP, 'prefix' => 'cake_test_');
9999
$result = Cache::config('pluginLibEngine', $settings);
100-
$this->assertEqual($result, Cache::config('pluginLibEngine'));
100+
$this->assertEquals($result, Cache::config('pluginLibEngine'));
101101

102102
Cache::drop('libEngine');
103103
Cache::drop('pluginLibEngine');
@@ -149,10 +149,10 @@ public function testConfigChange() {
149149
$_cacheConfigTests = Cache::config('tests');
150150

151151
$result = Cache::config('sessions', array('engine'=> 'File', 'path' => TMP . 'sessions'));
152-
$this->assertEqual($result['settings'], Cache::settings('sessions'));
152+
$this->assertEquals($result['settings'], Cache::settings('sessions'));
153153

154154
$result = Cache::config('tests', array('engine'=> 'File', 'path' => TMP . 'tests'));
155-
$this->assertEqual($result['settings'], Cache::settings('tests'));
155+
$this->assertEquals($result['settings'], Cache::settings('tests'));
156156

157157
Cache::config('sessions', $_cacheConfigSessions['settings']);
158158
Cache::config('tests', $_cacheConfigTests['settings']);
@@ -168,17 +168,17 @@ public function testConfigSettingDefaultConfigKey() {
168168

169169
Cache::write('value_one', 'I am cached', 'test_name');
170170
$result = Cache::read('value_one', 'test_name');
171-
$this->assertEqual($result, 'I am cached');
171+
$this->assertEquals($result, 'I am cached');
172172

173173
$result = Cache::read('value_one');
174-
$this->assertEqual($result, null);
174+
$this->assertEquals($result, null);
175175

176176
Cache::write('value_one', 'I am in default config!');
177177
$result = Cache::read('value_one');
178-
$this->assertEqual($result, 'I am in default config!');
178+
$this->assertEquals($result, 'I am in default config!');
179179

180180
$result = Cache::read('value_one', 'test_name');
181-
$this->assertEqual($result, 'I am cached');
181+
$this->assertEquals($result, 'I am cached');
182182

183183
Cache::delete('value_one', 'test_name');
184184
Cache::delete('value_one', 'default');
@@ -205,7 +205,7 @@ public function testWritingWithConfig() {
205205
'isWindows' => DIRECTORY_SEPARATOR == '\\',
206206
'mask' => 0664
207207
);
208-
$this->assertEqual($expected, Cache::settings('sessions'));
208+
$this->assertEquals($expected, Cache::settings('sessions'));
209209

210210
Cache::config('sessions', $_cacheConfigSessions['settings']);
211211
}
@@ -234,7 +234,7 @@ public function testInitSettings() {
234234

235235
$settings = Cache::settings();
236236
$expecting = $override + $initial;
237-
$this->assertEqual($settings, $expecting);
237+
$this->assertEquals($settings, $expecting);
238238
}
239239

240240
/**
@@ -275,19 +275,19 @@ public function testDrop() {
275275
*/
276276
public function testWriteEmptyValues() {
277277
Cache::write('App.falseTest', false);
278-
$this->assertIdentical(Cache::read('App.falseTest'), false);
278+
$this->assertSame(Cache::read('App.falseTest'), false);
279279

280280
Cache::write('App.trueTest', true);
281-
$this->assertIdentical(Cache::read('App.trueTest'), true);
281+
$this->assertSame(Cache::read('App.trueTest'), true);
282282

283283
Cache::write('App.nullTest', null);
284-
$this->assertIdentical(Cache::read('App.nullTest'), null);
284+
$this->assertSame(Cache::read('App.nullTest'), null);
285285

286286
Cache::write('App.zeroTest', 0);
287-
$this->assertIdentical(Cache::read('App.zeroTest'), 0);
287+
$this->assertSame(Cache::read('App.zeroTest'), 0);
288288

289289
Cache::write('App.zeroTest2', '0');
290-
$this->assertIdentical(Cache::read('App.zeroTest2'), '0');
290+
$this->assertSame(Cache::read('App.zeroTest2'), '0');
291291
}
292292

293293
/**
@@ -325,7 +325,7 @@ public function testCacheDisable() {
325325
Cache::config('test_cache_disable_1', array('engine'=> 'File', 'path' => TMP . 'tests'));
326326

327327
$this->assertTrue(Cache::write('key_1', 'hello', 'test_cache_disable_1'));
328-
$this->assertIdentical(Cache::read('key_1', 'test_cache_disable_1'), 'hello');
328+
$this->assertSame(Cache::read('key_1', 'test_cache_disable_1'), 'hello');
329329

330330
Configure::write('Cache.disable', true);
331331

@@ -335,7 +335,7 @@ public function testCacheDisable() {
335335
Configure::write('Cache.disable', false);
336336

337337
$this->assertTrue(Cache::write('key_3', 'hello', 'test_cache_disable_1'));
338-
$this->assertIdentical(Cache::read('key_3', 'test_cache_disable_1'), 'hello');
338+
$this->assertSame(Cache::read('key_3', 'test_cache_disable_1'), 'hello');
339339

340340
Configure::write('Cache.disable', true);
341341
Cache::config('test_cache_disable_2', array('engine'=> 'File', 'path' => TMP . 'tests'));
@@ -346,7 +346,7 @@ public function testCacheDisable() {
346346
Configure::write('Cache.disable', false);
347347

348348
$this->assertTrue(Cache::write('key_5', 'hello', 'test_cache_disable_2'));
349-
$this->assertIdentical(Cache::read('key_5', 'test_cache_disable_2'), 'hello');
349+
$this->assertSame(Cache::read('key_5', 'test_cache_disable_2'), 'hello');
350350

351351
Configure::write('Cache.disable', true);
352352

@@ -372,7 +372,7 @@ public function testSet() {
372372

373373
Cache::set(array('duration' => '+1 year'));
374374
$data = Cache::read('test_cache');
375-
$this->assertEqual($data, 'this is just a simple test of the cache system');
375+
$this->assertEquals($data, 'this is just a simple test of the cache system');
376376

377377
Cache::delete('test_cache');
378378

lib/Cake/Test/Case/Cache/Engine/ApcEngineTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ public function testReadAndWriteCache() {
6060

6161
$result = Cache::read('test', 'apc');
6262
$expecting = '';
63-
$this->assertEqual($result, $expecting);
63+
$this->assertEquals($result, $expecting);
6464

6565
$data = 'this is a test of the emergency broadcasting system';
6666
$result = Cache::write('test', $data, 'apc');
6767
$this->assertTrue($result);
6868

6969
$result = Cache::read('test', 'apc');
7070
$expecting = $data;
71-
$this->assertEqual($result, $expecting);
71+
$this->assertEquals($result, $expecting);
7272

7373
Cache::delete('test', 'apc');
7474
}
@@ -84,7 +84,7 @@ function testReadWriteDurationZero() {
8484
sleep(1);
8585

8686
$result = Cache::read('zero', 'apc');
87-
$this->assertEqual('Should save', $result);
87+
$this->assertEquals('Should save', $result);
8888
}
8989

9090
/**
@@ -147,16 +147,16 @@ public function testDecrement() {
147147
$this->assertTrue($result);
148148

149149
$result = Cache::decrement('test_decrement', 1, 'apc');
150-
$this->assertEqual(4, $result);
150+
$this->assertEquals(4, $result);
151151

152152
$result = Cache::read('test_decrement', 'apc');
153-
$this->assertEqual(4, $result);
153+
$this->assertEquals(4, $result);
154154

155155
$result = Cache::decrement('test_decrement', 2, 'apc');
156-
$this->assertEqual(2, $result);
156+
$this->assertEquals(2, $result);
157157

158158
$result = Cache::read('test_decrement', 'apc');
159-
$this->assertEqual(2, $result);
159+
$this->assertEquals(2, $result);
160160

161161
}
162162

@@ -172,16 +172,16 @@ public function testIncrement() {
172172
$this->assertTrue($result);
173173

174174
$result = Cache::increment('test_increment', 1, 'apc');
175-
$this->assertEqual(6, $result);
175+
$this->assertEquals(6, $result);
176176

177177
$result = Cache::read('test_increment', 'apc');
178-
$this->assertEqual(6, $result);
178+
$this->assertEquals(6, $result);
179179

180180
$result = Cache::increment('test_increment', 2, 'apc');
181-
$this->assertEqual(8, $result);
181+
$this->assertEquals(8, $result);
182182

183183
$result = Cache::read('test_increment', 'apc');
184-
$this->assertEqual(8, $result);
184+
$this->assertEquals(8, $result);
185185
}
186186

187187
/**

lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ public function tearDown() {
6262
*/
6363
public function testCacheDirChange() {
6464
$result = Cache::config('sessions', array('engine'=> 'File', 'path' => TMP . 'sessions'));
65-
$this->assertEqual($result['settings'], Cache::settings('sessions'));
65+
$this->assertEquals($result['settings'], Cache::settings('sessions'));
6666

6767
$result = Cache::config('sessions', array('engine'=> 'File', 'path' => TMP . 'tests'));
68-
$this->assertEqual($result['settings'], Cache::settings('sessions'));
69-
$this->assertNotEqual($result['settings'], Cache::settings('default'));
68+
$this->assertEquals($result['settings'], Cache::settings('sessions'));
69+
$this->assertNotEquals($result['settings'], Cache::settings('default'));
7070
}
7171

7272
/**
@@ -84,15 +84,15 @@ public function testReadAndWriteCache() {
8484

8585
$result = Cache::read('test', 'file_test');
8686
$expecting = '';
87-
$this->assertEqual($result, $expecting);
87+
$this->assertEquals($result, $expecting);
8888

8989
$data = 'this is a test of the emergency broadcasting system';
9090
$result = Cache::write('test', $data, 'file_test');
9191
$this->assertTrue(file_exists(CACHE . 'cake_test'));
9292

9393
$result = Cache::read('test', 'file_test');
9494
$expecting = $data;
95-
$this->assertEqual($result, $expecting);
95+
$this->assertEquals($result, $expecting);
9696

9797
Cache::delete('test', 'file_test');
9898
}
@@ -180,9 +180,9 @@ public function testSerialize() {
180180

181181
$delete = Cache::delete('serialize_test', 'file_test');
182182

183-
$this->assertIdentical($read, serialize($data));
183+
$this->assertSame($read, serialize($data));
184184

185-
$this->assertIdentical(unserialize($newread), $data);
185+
$this->assertSame(unserialize($newread), $data);
186186
}
187187

188188
/**
@@ -243,11 +243,11 @@ public function testClearWithPrefixes() {
243243
$FileOne->write('prefix_one_key_one', $data1, DAY);
244244
$FileTwo->write('prefix_two_key_two', $data2, DAY);
245245

246-
$this->assertEqual($FileOne->read('prefix_one_key_one'), $expected);
247-
$this->assertEqual($FileTwo->read('prefix_two_key_two'), $expected);
246+
$this->assertEquals($FileOne->read('prefix_one_key_one'), $expected);
247+
$this->assertEquals($FileTwo->read('prefix_two_key_two'), $expected);
248248

249249
$FileOne->clear(false);
250-
$this->assertEqual($FileTwo->read('prefix_two_key_two'), $expected, 'secondary config was cleared by accident.');
250+
$this->assertEquals($FileTwo->read('prefix_two_key_two'), $expected, 'secondary config was cleared by accident.');
251251
$FileTwo->clear(false);
252252
}
253253

@@ -262,7 +262,7 @@ public function testKeyPath() {
262262
$this->assertTrue(file_exists(CACHE . 'cake_views_countries_something'));
263263

264264
$result = Cache::read('views.countries.something', 'file_test');
265-
$this->assertEqual($result, 'here');
265+
$this->assertEquals($result, 'here');
266266

267267
$result = Cache::clear(false, 'file_test');
268268
$this->assertTrue($result);
@@ -308,7 +308,7 @@ public function testRemoveWindowsSlashesFromCache() {
308308
Cache::write('test_dir_map', $expected, 'windows_test');
309309
$data = Cache::read('test_dir_map', 'windows_test');
310310
Cache::delete('test_dir_map', 'windows_test');
311-
$this->assertEqual($expected, $data);
311+
$this->assertEquals($expected, $data);
312312

313313
Cache::drop('windows_test');
314314
}
@@ -321,14 +321,14 @@ public function testRemoveWindowsSlashesFromCache() {
321321
public function testWriteQuotedString() {
322322
Cache::config('file_test', array('engine' => 'File', 'path' => TMP . 'tests'));
323323
Cache::write('App.doubleQuoteTest', '"this is a quoted string"', 'file_test');
324-
$this->assertIdentical(Cache::read('App.doubleQuoteTest', 'file_test'), '"this is a quoted string"');
324+
$this->assertSame(Cache::read('App.doubleQuoteTest', 'file_test'), '"this is a quoted string"');
325325
Cache::write('App.singleQuoteTest', "'this is a quoted string'", 'file_test');
326-
$this->assertIdentical(Cache::read('App.singleQuoteTest', 'file_test'), "'this is a quoted string'");
326+
$this->assertSame(Cache::read('App.singleQuoteTest', 'file_test'), "'this is a quoted string'");
327327

328328
Cache::config('file_test', array('isWindows' => true, 'path' => TMP . 'tests'));
329-
$this->assertIdentical(Cache::read('App.doubleQuoteTest', 'file_test'), '"this is a quoted string"');
329+
$this->assertSame(Cache::read('App.doubleQuoteTest', 'file_test'), '"this is a quoted string"');
330330
Cache::write('App.singleQuoteTest', "'this is a quoted string'", 'file_test');
331-
$this->assertIdentical(Cache::read('App.singleQuoteTest', 'file_test'), "'this is a quoted string'");
331+
$this->assertSame(Cache::read('App.singleQuoteTest', 'file_test'), "'this is a quoted string'");
332332
Cache::delete('App.singleQuoteTest', 'file_test');
333333
Cache::delete('App.doubleQuoteTest', 'file_test');
334334
}
@@ -361,31 +361,31 @@ public function testMaskSetting() {
361361
$write = Cache::write('masking_test', $data, 'mask_test');
362362
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
363363
$expected = '0664';
364-
$this->assertEqual($result, $expected);
364+
$this->assertEquals($result, $expected);
365365
Cache::delete('masking_test', 'mask_test');
366366
Cache::drop('mask_test');
367367

368368
Cache::config('mask_test', array('engine' => 'File', 'mask' => 0666, 'path' => TMP . 'tests'));
369369
$write = Cache::write('masking_test', $data, 'mask_test');
370370
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
371371
$expected = '0666';
372-
$this->assertEqual($result, $expected);
372+
$this->assertEquals($result, $expected);
373373
Cache::delete('masking_test', 'mask_test');
374374
Cache::drop('mask_test');
375375

376376
Cache::config('mask_test', array('engine' => 'File', 'mask' => 0644, 'path' => TMP . 'tests'));
377377
$write = Cache::write('masking_test', $data, 'mask_test');
378378
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
379379
$expected = '0644';
380-
$this->assertEqual($result, $expected);
380+
$this->assertEquals($result, $expected);
381381
Cache::delete('masking_test', 'mask_test');
382382
Cache::drop('mask_test');
383383

384384
Cache::config('mask_test', array('engine' => 'File', 'mask' => 0640, 'path' => TMP . 'tests'));
385385
$write = Cache::write('masking_test', $data, 'mask_test');
386386
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS .'cake_masking_test')), -4);
387387
$expected = '0640';
388-
$this->assertEqual($result, $expected);
388+
$this->assertEquals($result, $expected);
389389
Cache::delete('masking_test', 'mask_test');
390390
Cache::drop('mask_test');
391391
}

0 commit comments

Comments
 (0)