/**
* Test validateSchema()
*
* @return void
*/
public function testValidateSchema()
{
// Set the json array schema
$schemaArray = ['dogs' => ['name' => 'string:unique', 'paws' => 'yesTheyHaveThemSometimes:index', 'canines' => 'boolean', 'hair' => 'string(50):index', 'ears_invalid' => 'string:thisIsMyInvalidModifier', 'ears_valid' => "string:after('id')"], 'create_cats_table' => ['hair' => 'boolean'], 'posts_tags_pivot' => null];
// Validate schema
$errors = $this->makeMigrationJson->validateSchema($schemaArray);
// The 'paws' section should come back with invalid column type error
$this->assertTrue(isset($errors['dogs']['paws']['columnType']), 'columnType: "paws" was supposed to come back with a column type error, instead we got: ' . json_encode($errors));
// The 'ears_invalid' section should come back with invalid column type error
$this->assertTrue(isset($errors['dogs']['ears_invalid']['columnModifier']), 'columnModifier: "ears_invalid" was supposed to come back with a column modifier error, instead we got: ' . json_encode($errors));
// The 'hair' section should not come back with errors because of its optional column type parameters
$this->assertFalse(isset($errors['dogs']['hair']), 'columnType: "hair:string(50):index" should be allowed to be validated as a "string", not as "string(50)": ');
// The 'ears_valid' section should not come back with errors because it is a valid column modifier or index
$this->assertFalse(isset($errors['dogs']['ears_valid']), 'columnType: "ears_valid" should not come back with errors because it is a valid column modifier or index');
}