Skip to content

Commit a6bc7c4

Browse files
author
Mark Hodge
committed
Update test exception messages to use translation
1 parent ae74f8b commit a6bc7c4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ public function testGetVersionWithExceptionNoAutoincrement()
118118
->will($this->returnValue([]));
119119

120120
$this->expectException('Exception');
121-
$this->expectExceptionMessage("Table status for `{$changelogTableName}` is incorrect. Can`t fetch version id.");
121+
$this->expectExceptionMessage(
122+
__("Table status for %1 is incorrect. Can`t fetch version id.", [$changelogTableName])
123+
);
122124
$this->model->setViewId('viewIdtest');
123125
$this->model->getVersion();
124126
}
@@ -130,7 +132,7 @@ public function testGetVersionWithExceptionNoTable()
130132
$this->mockGetTableName();
131133

132134
$this->expectException('Exception');
133-
$this->expectExceptionMessage("Table {$changelogTableName} does not exist");
135+
$this->expectExceptionMessage(__("Table %1 does not exist", [$changelogTableName]));
134136
$this->model->setViewId('viewIdtest');
135137
$this->model->getVersion();
136138
}
@@ -142,7 +144,7 @@ public function testDrop()
142144
$this->mockGetTableName();
143145

144146
$this->expectException('Exception');
145-
$this->expectExceptionMessage("Table {$changelogTableName} does not exist");
147+
$this->expectExceptionMessage(__("Table %1 does not exist", [$changelogTableName]));
146148
$this->model->setViewId('viewIdtest');
147149
$this->model->drop();
148150
}
@@ -234,7 +236,7 @@ public function testGetListWithException()
234236
$this->mockGetTableName();
235237

236238
$this->expectException('Exception');
237-
$this->expectExceptionMessage("Table {$changelogTableName} does not exist");
239+
$this->expectExceptionMessage(__("Table %1 does not exist", [$changelogTableName]));
238240
$this->model->setViewId('viewIdtest');
239241
$this->model->getList(mt_rand(1, 200), mt_rand(201, 400));
240242
}
@@ -246,7 +248,7 @@ public function testClearWithException()
246248
$this->mockGetTableName();
247249

248250
$this->expectException('Exception');
249-
$this->expectExceptionMessage("Table {$changelogTableName} does not exist");
251+
$this->expectExceptionMessage(__("Table %1 does not exist", [$changelogTableName]));
250252
$this->model->setViewId('viewIdtest');
251253
$this->model->clear(mt_rand(1, 200));
252254
}

0 commit comments

Comments
 (0)