Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell authored and StyleCIBot committed Aug 12, 2017
1 parent 2ffadfe commit add88b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/DefinitionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public function testModelNotFound()
} catch (ModelNotFoundException $e) {
$this->assertSame("The model class '$model' is undefined.", $e->getMessage());
$this->assertSame($model, $e->getModelClass());

throw $e;
}
}
Expand Down Expand Up @@ -210,6 +211,7 @@ public function testShouldThrowExceptionWhenLoadingANonExistentGroup()
} catch (DefinitionNotFoundException $e) {
$this->assertSame("The model definition '$model' is undefined.", $e->getMessage());
$this->assertSame($model, $e->getDefinitionName());

throw $e;
}
}
Expand All @@ -227,6 +229,7 @@ public function testGroupDefineNoBaseModel()
} catch (DefinitionNotFoundException $e) {
$this->assertSame("The model definition 'DogModelStub' is undefined.", $e->getMessage());
$this->assertSame('DogModelStub', $e->getDefinitionName());

throw $e;
}
}
Expand All @@ -241,6 +244,7 @@ public function testCannotDefineAgain()
} catch (DefinitionAlreadyDefinedException $e) {
$this->assertSame("The model definition 'UserModelStub' has already been defined.", $e->getMessage());
$this->assertSame('UserModelStub', $e->getDefinitionName());

throw $e;
}
}
Expand Down Expand Up @@ -311,6 +315,7 @@ public function testShouldThrowExceptionWhenLoadingANonExistentDirectory()
} catch (DirectoryNotFoundException $e) {
$this->assertSame("The directory '$path' was not found.", $e->getMessage());
$this->assertSame($path, $e->getPath());

throw $e;
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/FactoryMuffinTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function testShouldThrowDefinitionNotFoundException()
} catch (DefinitionNotFoundException $e) {
$this->assertSame("The model definition '$model' is undefined.", $e->getMessage());
$this->assertSame($model, $e->getDefinitionName());

throw $e;
}
}
Expand Down
10 changes: 10 additions & 0 deletions tests/SaveAndDeleteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public function testShouldThrowExceptionAfterSaveMethodRename()
$this->assertSame($model, $e->getModelClass());
$this->assertSame('foo', $e->getMethodName());
$this->reload();

throw $e;
}

Expand All @@ -94,6 +95,7 @@ public function testShouldThrowExceptionAfterDeleteMethodRename()
$this->assertSame($model, $exceptions[0]->getModelClass());
$this->assertSame('bar', $exceptions[0]->getMethodName());
$this->reload();

throw $e;
}

Expand All @@ -111,6 +113,7 @@ public function testShouldThrowExceptionOnModelSaveFailure()
$this->assertSame("We could not save the model: '$model'.", $e->getMessage());
$this->assertSame($model, $e->getModelClass());
$this->assertNull($e->getValidationErrors());

throw $e;
}
}
Expand All @@ -127,6 +130,7 @@ public function testShouldThrowExceptionOnModelDeleteFailure()
$exceptions = $e->getExceptions();
$this->assertSame('We encountered 1 problem while trying to delete the saved models.', $e->getMessage());
$this->assertSame("We could not delete the model: '$model'.", $exceptions[0]->getMessage());

throw $e;
}
}
Expand All @@ -143,6 +147,7 @@ public function testShouldAlsoThrowExceptionOnModelDeleteFailure()
$exceptions = $e->getExceptions();
$this->assertSame('We encountered 1 problem while trying to delete the saved models.', $e->getMessage());
$this->assertSame('OH NOES!', $exceptions[0]->getMessage());

throw $e;
}
}
Expand All @@ -158,6 +163,7 @@ public function testShouldThrowExceptionWithoutSaveMethod()
$this->assertSame("The save method 'save' was not found on the model: '$model'.", $e->getMessage());
$this->assertSame($model, $e->getModelClass());
$this->assertSame('save', $e->getMethodName());

throw $e;
}
}
Expand All @@ -176,6 +182,7 @@ public function testShouldThrowExceptionWithoutDeleteMethod()
$this->assertSame("The delete method 'delete' was not found on the model: '$model'.", $exceptions[0]->getMessage());
$this->assertSame($model, $exceptions[0]->getModelClass());
$this->assertSame('delete', $exceptions[0]->getMethodName());

throw $e;
}
}
Expand All @@ -191,6 +198,7 @@ public function testShouldThrowExceptionWithValidationErrors()
$this->assertSame("Failed to save! We could not save the model: '$model'.", $e->getMessage());
$this->assertSame($model, $e->getModelClass());
$this->assertSame('Failed to save!', $e->getValidationErrors());

throw $e;
}
}
Expand All @@ -206,6 +214,7 @@ public function testShouldThrowExceptionWithBadValidationErrors()
$this->assertSame("Oh noes. We could not save the model: '$model'.", $e->getMessage());
$this->assertSame($model, $e->getModelClass());
$this->assertSame('Oh noes.', $e->getValidationErrors());

throw $e;
}
}
Expand All @@ -228,6 +237,7 @@ public function testShouldThrowMultipleDeletionExceptions()
$this->assertSame('delete', $exceptions[1]->getMethodName());
$this->assertInternalType('array', $e->getExceptions());
$this->assertCount(2, $e->getExceptions());

throw $e;
}
}
Expand Down

0 comments on commit add88b7

Please sign in to comment.