Skip to content

Instantly share code, notes, and snippets.

@dionyziz
Last active August 29, 2015 13:57
Show Gist options
  • Save dionyziz/9352298 to your computer and use it in GitHub Desktop.
Save dionyziz/9352298 to your computer and use it in GitHub Desktop.
<?php
public function testAddFieldNoFieldName() {
$this->createTable();
$emptySuccess = false;
try {
Migration::addField( 'testTable' );
}
catch ( MigrationException $e ) {
$emptySuccess = true;
}
$this->assertTrue( $emptySuccess, 'addField must not create a field when fieldname is empty' );
}
?>
<?php
public function testAddFieldNoFieldName() {
$this->createTable();
$this->assertThrows( function() {
Migration::addField( 'testTable' );
}, 'MigrationException', 'addField must not create a field when fieldname is empty' );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment