Skip to content

Commit

Permalink
Updating deprecated phpunit method names
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed Feb 27, 2014
1 parent 891d531 commit fb154ba
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 71 deletions.
30 changes: 15 additions & 15 deletions Test/Case/Console/Command/MigrationShellTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function tearDown() {
*/
public function testStartup() {
$this->Shell->connection = 'default';
$this->assertEqual($this->Shell->type, 'TestMigrationPlugin');
$this->assertEquals($this->Shell->type, 'TestMigrationPlugin');
$this->Shell->params = array(
'connection' => 'test',
'plugin' => 'Migrations',
Expand All @@ -158,8 +158,8 @@ public function testStartup() {
'precheck' => 'Migrations.PrecheckException'
);
$this->Shell->startup();
$this->assertEqual($this->Shell->connection, 'test');
$this->assertEqual($this->Shell->type, 'Migrations');
$this->assertEquals($this->Shell->connection, 'test');
$this->assertEquals($this->Shell->type, 'Migrations');
}

/**
Expand Down Expand Up @@ -374,7 +374,7 @@ public function testFromComparisonTableActions() {
'up' => array('create_table' => $this->tables),
'down' => array('drop_table' => array('users', 'posts'))
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

$comparison = array('posts' => array('add' => $this->tables['posts']));
$oldTables = array('users' => $this->tables['users']);
Expand All @@ -387,7 +387,7 @@ public function testFromComparisonTableActions() {
'drop_table' => array('posts')
)
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

$comparison = array();
$oldTables = array('posts' => $this->tables['posts'], 'users' => $this->tables['users']);
Expand All @@ -401,7 +401,7 @@ public function testFromComparisonTableActions() {
'create_table' => array('posts' => $this->tables['posts'])
)
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);
}

/**
Expand Down Expand Up @@ -432,7 +432,7 @@ public function testFromComparisonFieldActions() {
)
)
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

$comparison = array(
'posts' => array('add' => array(
Expand All @@ -454,7 +454,7 @@ public function testFromComparisonFieldActions() {
)
)
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

$comparison = array(
'posts' => array('add' => array(
Expand All @@ -478,7 +478,7 @@ public function testFromComparisonFieldActions() {
)
)
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

// Drop field/index
$oldTables['posts']['views'] = array('type' => 'integer', 'null' => false);
Expand All @@ -502,7 +502,7 @@ public function testFromComparisonFieldActions() {
)
)
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

$comparison = array(
'posts' => array('drop' => array(
Expand All @@ -522,7 +522,7 @@ public function testFromComparisonFieldActions() {
)
)
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

$comparison = array(
'posts' => array('drop' => array(
Expand All @@ -546,7 +546,7 @@ public function testFromComparisonFieldActions() {
)
)
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

// Change field
$comparison = array(
Expand All @@ -571,7 +571,7 @@ public function testFromComparisonFieldActions() {
)
)
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

// Change field with/out length
$oldTables = array('users' => $this->tables['users']);
Expand Down Expand Up @@ -600,7 +600,7 @@ public function testFromComparisonFieldActions() {
)
)
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);
}

/**
Expand Down Expand Up @@ -671,7 +671,7 @@ public function testWriteMigration() {
),
);
TEXT;
$this->assertEqual($result, str_replace("\r\n", "\n", $expected));
$this->assertEquals($result, str_replace("\r\n", "\n", $expected));
$this->_unlink('12345_migration_test_file.php');
}

Expand Down
8 changes: 4 additions & 4 deletions Test/Case/Lib/Migration/PrecheckConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,24 +281,24 @@ public function testAlterField() {
$Migration->initDb();

$fields = $this->db->describe($Model);
$this->assertEqual($fields['published']['default'], 'N');
$this->assertEquals($fields['published']['default'], 'N');

$this->assertTrue($Migration->run('up'));
$fields = $this->db->describe($Model);
$this->assertEqual($fields['published']['default'], 'Y');
$this->assertEquals($fields['published']['default'], 'Y');

try {
$Migration->migration['up']['alter_field']['posts']['inexistent'] = array('default' => 'N');
$Migration->run('up');
$this->fail('No expectation triggered');
$this->setExpectedException('MigrationException');
} catch (MigrationException $e) {
$this->assertEqual('Undefined index: inexistent', $e->getMessage());
$this->assertEquals('Undefined index: inexistent', $e->getMessage());
}

$this->assertTrue($Migration->run('down'));
$fields = $this->db->describe($Model);
$this->assertEqual($fields['published']['default'], 'N');
$this->assertEquals($fields['published']['default'], 'N');
}

/**
Expand Down
20 changes: 10 additions & 10 deletions Test/Case/Lib/MigrationVersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function testGetMapping() {
'migrated' => null
)
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

$result = $this->Version->getMapping('migrations');
$expected = array(
Expand All @@ -131,7 +131,7 @@ public function testGetMapping() {
'migrated' => null
)
);
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);
}

/**
Expand All @@ -144,24 +144,24 @@ public function testGetMigration() {
$this->Version->getMigration('inexistent_migration', 'InexistentMigration', 'test_migration_plugin');
$this->fail('No exception triggered');
} catch (MigrationVersionException $e) {
$this->assertEqual('File `inexistent_migration.php` not found in the TestMigrationPlugin Plugin.', $e->getMessage());
$this->assertEquals('File `inexistent_migration.php` not found in the TestMigrationPlugin Plugin.', $e->getMessage());
}

try {
$this->Version->getMigration('blank_file', 'BlankFile', 'test_migration_plugin');
$this->fail('No exception triggered');
} catch (MigrationVersionException $e) {
$this->assertEqual('Class `BlankFile` not found on file `blank_file.php` for TestMigrationPlugin Plugin.', $e->getMessage());
$this->assertEquals('Class `BlankFile` not found on file `blank_file.php` for TestMigrationPlugin Plugin.', $e->getMessage());
}

$result = $this->Version->getMigration('001_schema_dump', 'M4af6d40056b04408808500cb58157726', 'test_migration_plugin');
$this->assertInstanceOf('M4af6d40056b04408808500cb58157726', $result);
$this->assertEqual($result->description, 'Version 001 (schema dump) of TestMigrationPlugin');
$this->assertEquals($result->description, 'Version 001 (schema dump) of TestMigrationPlugin');

// Calling twice to check if it will not try to redeclare the class
$result = $this->Version->getMigration('001_schema_dump', 'M4af6d40056b04408808500cb58157726', 'test_migration_plugin');
$this->assertInstanceOf('M4af6d40056b04408808500cb58157726', $result);
$this->assertEqual($result->description, 'Version 001 (schema dump) of TestMigrationPlugin');
$this->assertEquals($result->description, 'Version 001 (schema dump) of TestMigrationPlugin');
}

/**
Expand All @@ -176,7 +176,7 @@ public function testSetGetVersion() {
$this->Version->expects($this->at(0))->method('getMapping')->will($this->returnValue($this->_mapping()));
$result = $this->Version->getVersion('inexistent_plugin');
$expected = 0;
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

// Setting as 1
$this->Version->expects($this->at(0))->method('getMapping')->will($this->returnValue($this->_mapping()));
Expand All @@ -185,7 +185,7 @@ public function testSetGetVersion() {
$this->assertTrue(!empty($setResult));
$result = $this->Version->getVersion('inexistent_plugin');
$expected = 1;
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

// Setting as 2
$this->Version->expects($this->at(0))->method('getMapping')->will($this->returnValue($this->_mapping(1, 1)));
Expand All @@ -194,7 +194,7 @@ public function testSetGetVersion() {
$this->assertTrue(!empty($setResult));
$result = $this->Version->getVersion('inexistent_plugin');
$expected = 2;
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);

// Setting as 1
$this->Version->expects($this->at(0))->method('getMapping')->will($this->returnValue($this->_mapping(1, 2)));
Expand All @@ -203,7 +203,7 @@ public function testSetGetVersion() {
$this->assertTrue(!empty($setResult));
$result = $this->Version->getVersion('inexistent_plugin');
$expected = 1;
$this->assertEqual($result, $expected);
$this->assertEquals($result, $expected);
}

/**
Expand Down
Loading

0 comments on commit fb154ba

Please sign in to comment.