File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ public function testCheckDatabaseTablePrefixWrongFormat()
89
89
90
90
/**
91
91
* @expectedException \InvalidArgumentException
92
- * @expectedExceptionMessage Table prefix length can't be more then
92
+ * @expectedExceptionMessage Table prefix length can't be more than
93
93
*/
94
94
public function testCheckDatabaseTablePrefixWrongLength ()
95
95
{
Original file line number Diff line number Diff line change 16
16
class DbValidator
17
17
{
18
18
19
+ /**
20
+ * Db prefix max length
21
+ */
19
22
const DB_PREFIX_LENGTH = 10 ;
20
23
21
24
/**
@@ -47,12 +50,15 @@ public function checkDatabaseTablePrefix($prefix)
47
50
//The table prefix should contain only letters (a-z), numbers (0-9) or underscores (_);
48
51
// the first character should be a letter.
49
52
if ($ prefix !== '' && !preg_match ('/^([a-zA-Z])([[:alnum:]_]+)$/ ' , $ prefix )) {
50
- throw new \InvalidArgumentException ('Please correct the table prefix format. ' );
53
+ throw new \InvalidArgumentException (
54
+ 'Please correct the table prefix format, should contain only numbers, letters or underscores. '
55
+ .' The first character should be a letter. '
56
+ );
51
57
}
52
58
53
59
if (strlen ($ prefix ) > self ::DB_PREFIX_LENGTH ) {
54
60
throw new \InvalidArgumentException (
55
- 'Table prefix length can \'t be more then ' . self ::DB_PREFIX_LENGTH . ' characters. '
61
+ 'Table prefix length can \'t be more than ' . self ::DB_PREFIX_LENGTH . ' characters. '
56
62
);
57
63
}
58
64
You can’t perform that action at this time.
0 commit comments