-
Notifications
You must be signed in to change notification settings - Fork 7
Updating deprecated @expectedException annotations #12
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -32,6 +32,9 @@ abstract class ExceptionsTest extends BaseTest | |||||
|
||||||
public function testDropNonExisted(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\TableException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to drop table '.+'\.'.+', table does not exists/"); | ||||||
|
||||||
Comment on lines
+35
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
$this->repository->registerMigration('m', DropNonExistedMigration::class); | ||||||
|
@@ -46,6 +49,9 @@ public function testDropNonExisted(): void | |||||
|
||||||
public function testCreateEmpty(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\TableException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to create table '.+'\.'.+', no columns were added/"); | ||||||
|
||||||
Comment on lines
+52
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
$this->repository->registerMigration('m', CreateEmptyMigration::class); | ||||||
|
@@ -60,6 +66,9 @@ public function testCreateEmpty(): void | |||||
|
||||||
public function testCreateDuplicate(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\TableException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to create table '.+'\.'.+', table already exists/"); | ||||||
|
||||||
Comment on lines
+69
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -79,6 +88,9 @@ public function testCreateDuplicate(): void | |||||
|
||||||
public function testUpdateNonExisted(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\TableException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to update table '.+'\.'.+', no table exists/"); | ||||||
|
||||||
Comment on lines
+91
to
+93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -94,6 +106,9 @@ public function testUpdateNonExisted(): void | |||||
|
||||||
public function testRenameNonExisted(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\TableException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to rename table '.+'\.'.+', table does not exists/"); | ||||||
|
||||||
Comment on lines
+109
to
+111
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -109,6 +124,9 @@ public function testRenameNonExisted(): void | |||||
|
||||||
public function testRenameButBusy(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\TableException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to rename table '.+'\.'.+', table '.+' already exists/"); | ||||||
|
||||||
Comment on lines
+127
to
+129
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -132,6 +150,9 @@ public function testRenameButBusy(): void | |||||
|
||||||
public function testDuplicateColumn(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\ColumnException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to create column '.+'\.'.+', column already exists/"); | ||||||
|
||||||
Comment on lines
+153
to
+155
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -152,6 +173,9 @@ public function testDuplicateColumn(): void | |||||
|
||||||
public function testDropNonExistedIndex(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\IndexException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to drop index '.+'\.(.+), index does not exists/"); | ||||||
|
||||||
Comment on lines
+176
to
+178
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -172,6 +196,9 @@ public function testDropNonExistedIndex(): void | |||||
|
||||||
public function testAlterNonExistedIndex(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\IndexException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to alter index '.+'\.(.+), no such index/"); | ||||||
|
||||||
Comment on lines
+199
to
+201
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -192,6 +219,9 @@ public function testAlterNonExistedIndex(): void | |||||
|
||||||
public function testAlterNonExistedColumn(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\ColumnException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to alter column '.+'\.'.+', column does not exists/"); | ||||||
|
||||||
Comment on lines
+222
to
+224
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -211,6 +241,9 @@ public function testAlterNonExistedColumn(): void | |||||
|
||||||
public function testRenameNonExistedColumn(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\ColumnException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to rename column '.+'\.'.+', column does not exists/"); | ||||||
|
||||||
Comment on lines
+244
to
+246
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -230,6 +263,9 @@ public function testRenameNonExistedColumn(): void | |||||
|
||||||
public function testRenameDuplicateExistedColumn(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\ColumnException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to rename column '.+'\.'.+', column '.+' already exists/"); | ||||||
|
||||||
Comment on lines
+266
to
+268
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -251,6 +287,9 @@ public function testRenameDuplicateExistedColumn(): void | |||||
|
||||||
public function testAddForeignNoTarget(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\ForeignKeyException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to add foreign key 'tests_sample'.'column', foreign table 'target' does not exists/"); | ||||||
|
||||||
Comment on lines
+290
to
+292
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -272,6 +311,9 @@ public function testAddForeignNoTarget(): void | |||||
|
||||||
public function testAddForeignNoTargetColumn(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\ForeignKeyException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to add foreign key '.+'\.'.+', foreign column '.+'\.'.+' does not exists/"); | ||||||
|
||||||
Comment on lines
+314
to
+316
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -297,6 +339,9 @@ public function testAddForeignNoTargetColumn(): void | |||||
|
||||||
public function testAlterForeignNoFK(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\ForeignKeyException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to alter foreign key '.+'\.(.+), key does not exists/"); | ||||||
|
||||||
Comment on lines
+342
to
+344
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -317,6 +362,9 @@ public function testAlterForeignNoFK(): void | |||||
|
||||||
public function testAlterForeignNoTable(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\ForeignKeyException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to alter foreign key '.+'\.'.+', foreign table '.+' does not exists/"); | ||||||
|
||||||
Comment on lines
+365
to
+367
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -343,6 +391,9 @@ public function testAlterForeignNoTable(): void | |||||
|
||||||
public function testAlterForeignNoColumn(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\ForeignKeyException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to alter foreign key '.+'\.'.+', foreign column '.+'\.'.+' does not exists/"); | ||||||
|
||||||
Comment on lines
+394
to
+396
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -373,6 +424,9 @@ public function testAlterForeignNoColumn(): void | |||||
|
||||||
public function testDropNonExistedFK(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\ForeignKeyException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to drop foreign key '.+'\.'.+', foreign key does not exists/"); | ||||||
|
||||||
Comment on lines
+427
to
+429
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -394,6 +448,9 @@ public function testDropNonExistedFK(): void | |||||
|
||||||
public function testAddExisted(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\Operation\ForeignKeyException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to add foreign key '.+'\.(.+), foreign key already exists/"); | ||||||
|
||||||
Comment on lines
+451
to
+453
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
//Create thought migration | ||||||
$this->migrator->configure(); | ||||||
|
||||||
|
@@ -439,20 +496,23 @@ public function testBadDateFormatMigrationFile(): void | |||||
public function testDuplicateClassMigration(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\RepositoryException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to register migration '.+', migration already exists/"); | ||||||
$this->repository->registerMigration('unique_name_1', DuplicateColumnMigration::class); | ||||||
$this->repository->registerMigration('unique_name_2', DuplicateColumnMigration::class); | ||||||
} | ||||||
|
||||||
public function testDuplicateFileNameMigration(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\RepositoryException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to register migration 'camel_case_duplicate', migration under the same name already exists/"); | ||||||
$this->repository->registerMigration('camel_case_duplicate', DuplicateColumnMigration::class); | ||||||
$this->repository->registerMigration('camelCaseDuplicate', CreateEmptyMigration::class); | ||||||
} | ||||||
|
||||||
public function testInvalidMigration(): void | ||||||
{ | ||||||
$this->expectException(\Spiral\Migrations\Exception\RepositoryException::class); | ||||||
$this->expectExceptionMessageMatches("/Unable to register migration '.+', representing class does not exists/"); | ||||||
$this->repository->registerMigration('m', 'invalid'); | ||||||
} | ||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.