Skip to content

Commit 7dde426

Browse files
author
daitken
committed
7.x grammar fixes
1 parent 266da04 commit 7dde426

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

Enum.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ abstract class Enum {
4444
}
4545
else {
4646
$class_name = get_class($this);
47-
throw new InvalidArgumentException("No value provided, and no __default value defined for the Class '{$class_name}'.");
47+
throw new InvalidArgumentException("No value provided, and no __default value defined for the class '{$class_name}'.");
4848
}
4949
}
5050
elseif (array_search($value, $consts) !== FALSE) {

tests/DOMHelpers.test

+6-6
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ EOT;
6666
$list = $root->getElementsByTagName('c');
6767
$c1 = $list->item(0);
6868
$path = get_dom_node_xpath($c1);
69-
$this->assertEqual($path, "/*[local-name() = 'root'][1]/*[local-name() = 'a'][1]/*[local-name() = 'c'][1]", 'get_dom_node_xpath: Path to grand child element with different type than the first two.');
69+
$this->assertEqual($path, "/*[local-name() = 'root'][1]/*[local-name() = 'a'][1]/*[local-name() = 'c'][1]", 'get_dom_node_xpath: Path to grandchild element with different type than the first two.');
7070
$c2 = $list->item(1);
7171
$path = get_dom_node_xpath($c2);
7272
$this->assertEqual($path, "/*[local-name() = 'root'][1]/*[local-name() = 'c'][1]", 'get_dom_node_xpath: Path to child element with different type than the first two.');
7373
$list = $root->getElementsByTagName('b');
7474
$b1 = $list->item(0);
75-
$this->assertEqual(get_dom_node_xpath($b1), "/*[local-name() = 'root'][1]/*[local-name() = 'a'][1]/*[local-name() = 'b'][1]", 'get_dom_node_xpath: Path to grand child element with third type.');
75+
$this->assertEqual(get_dom_node_xpath($b1), "/*[local-name() = 'root'][1]/*[local-name() = 'a'][1]/*[local-name() = 'b'][1]", 'get_dom_node_xpath: Path to grandchild element with third type.');
7676
$b2 = $list->item(1);
77-
$this->assertEqual(get_dom_node_xpath($b2), "/*[local-name() = 'root'][1]/*[local-name() = 'a'][2]/*[local-name() = 'b'][1]", 'get_dom_node_xpath: Path to grand child element with third type but different parent.');
77+
$this->assertEqual(get_dom_node_xpath($b2), "/*[local-name() = 'root'][1]/*[local-name() = 'a'][2]/*[local-name() = 'b'][1]", 'get_dom_node_xpath: Path to grandchild element with third type but different parent.');
7878
}
7979

8080
public function testGetDomNodeXPathNamespaces() {
@@ -106,15 +106,15 @@ EOT;
106106
$list = $root->getElementsByTagName('c');
107107
$c1 = $list->item(0);
108108
$path = get_dom_node_xpath($c1);
109-
$this->assertEqual($path, "/*[local-name() = 'root'][1]/*[local-name() = 'a'][1]/*[local-name() = 'c'][1]", 'get_dom_node_xpath Namespaces: Path to grand child element with different type than the first two.');
109+
$this->assertEqual($path, "/*[local-name() = 'root'][1]/*[local-name() = 'a'][1]/*[local-name() = 'c'][1]", 'get_dom_node_xpath Namespaces: Path to grandchild element with different type than the first two.');
110110
$c2 = $list->item(1);
111111
$path = get_dom_node_xpath($c2);
112112
$this->assertEqual($path, "/*[local-name() = 'root'][1]/*[local-name() = 'c'][1]", 'get_dom_node_xpath Namespaces: Path to child element with different type than the first two.');
113113
$list = $root->getElementsByTagName('b');
114114
$b1 = $list->item(0);
115-
$this->assertEqual(get_dom_node_xpath($b1), "/*[local-name() = 'root'][1]/*[local-name() = 'a'][1]/*[local-name() = 'b'][1]", 'get_dom_node_xpath Namespaces: Path to grand child element with third type.');
115+
$this->assertEqual(get_dom_node_xpath($b1), "/*[local-name() = 'root'][1]/*[local-name() = 'a'][1]/*[local-name() = 'b'][1]", 'get_dom_node_xpath Namespaces: Path to grandchild element with third type.');
116116
$b2 = $list->item(1);
117-
$this->assertEqual(get_dom_node_xpath($b2), "/*[local-name() = 'root'][1]/*[local-name() = 'a'][2]/*[local-name() = 'b'][1]", 'get_dom_node_xpath Namespaces: Path to grand child element with third type but different parent.');
117+
$this->assertEqual(get_dom_node_xpath($b2), "/*[local-name() = 'root'][1]/*[local-name() = 'a'][2]/*[local-name() = 'b'][1]", 'get_dom_node_xpath Namespaces: Path to grandchild element with third type but different parent.');
118118
}
119119

120120
}

tests/DelimitedFile.test

+6-6
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class PHPLib_DelimitedFile_TestCase extends DrupalUnitTestCase {
6161
}
6262
$file->seek(1, SEEK_CUR);
6363
}
64-
$this->assert($successful, "DelimitedFile::isDelimiter() Correctly identified all delimiters.");
64+
$this->assert($successful, "DelimitedFile::isDelimiter() correctly identified all delimiters.");
6565
unset($file); // Destroy the reference to the file.
6666
}
6767

@@ -79,14 +79,14 @@ class PHPLib_DelimitedFile_TestCase extends DrupalUnitTestCase {
7979
$file->seek($i);
8080
if ($file->seekAfterDelimiter() !== $values[$i]) {
8181
$successful = FALSE;
82-
$this->assert($successful, t('DelimitedFile::seekAfterDelimiter() incorrectly moved to "%actual" expected "%expected"', array(
82+
$this->assert($successful, t('DelimitedFile::seekAfterDelimiter() incorrectly moved to "%actual" (expected: "%expected")', array(
8383
'%actual' => $file->pos,
8484
'%expected' => $values[$i]))
8585
);
8686
break;
8787
}
8888
}
89-
$this->assert($successful, "DelimitedFile::isDelimiter() Correctly seeked after all delimiters.");
89+
$this->assert($successful, "DelimitedFile::isDelimiter() correctly sought after all delimiters.");
9090
unset($file); // Destroy the reference to the file.
9191
}
9292

@@ -103,14 +103,14 @@ class PHPLib_DelimitedFile_TestCase extends DrupalUnitTestCase {
103103
$field = $file->getField();
104104
if (strcmp($field, $value)) {
105105
$successful = FALSE;
106-
$this->assert($successful, t('DelimitedFile::getField() failed to get field "%expected" returned "%actual"', array(
106+
$this->assert($successful, t('DelimitedFile::getField() incorrectly returned field "%actual" (expected: "%expected")', array(
107107
'%expected' => $value,
108108
'%actual' => $field))
109109
);
110110
break;
111111
}
112112
}
113-
$this->assert($successful, "DelimitedFile::getField() Correctly identified all fields.");
113+
$this->assert($successful, "DelimitedFile::getField() correctly identified all fields.");
114114
unset($file); // Destroy the reference to the file.
115115
}
116116

@@ -126,7 +126,7 @@ class PHPLib_DelimitedFile_TestCase extends DrupalUnitTestCase {
126126
$fields = $file->getFields(0);
127127
$this->assert(empty($fields), t('DelimitedFile::getFields() didn\'t return any fields for a count of 0.'));
128128
$fields = $file->getFields(2);
129-
$this->assertEqual(count($fields), 2, t('DelimitedFile::getFields() return the correct number of fields for the request of 2.'));
129+
$this->assertEqual(count($fields), 2, t('DelimitedFile::getFields() returned the correct number of fields for the request of 2.'));
130130
$file->rewind();
131131
$fields = $file->getFields(count($values));
132132
$this->assertEqual($fields, $values, t('DelimitedFile::getFields() retrieved all fields.'));

tests/File.test

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class PHPLib_File_TestCase extends DrupalUnitTestCase {
3737
parent::tearDown();
3838
unlink($this->filename);
3939
}
40-
40+
4141
private function writeToFile($content) {
4242
$handle = fopen($this->filename, 'wb');
4343
fwrite($handle, $content);
@@ -53,9 +53,9 @@ class PHPLib_File_TestCase extends DrupalUnitTestCase {
5353
$successful = $file->seek(-1);
5454
$this->assert(!$successful, t('File::seek() won\'t seek before the start of the file.'));
5555
$successful = $file->seek(1, SEEK_END);
56-
$this->assert($successful, t('File::seek() will seek passed the end of the file by default.'));
56+
$this->assert($successful, t('File::seek() will seek past the end of the file by default.'));
5757
$successful = $file->seek(1, SEEK_END, FALSE);
58-
$this->assert(!$successful, t('File::seek() won\'t seek passed the end of the file if direct not to.'));
58+
$this->assert(!$successful, t('File::seek() won\'t seek past the end of the file if directed not to.'));
5959
}
6060

6161
}

tests/TextFile.test

+14-14
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class PHPLib_TextFile_TestCase extends DrupalUnitTestCase {
6161
}
6262
$file->seek(1, SEEK_CUR);
6363
}
64-
$this->assert($successful, "TextFile::EOL() Correctly identified all Unix EOL.");
64+
$this->assert($successful, "TextFile::EOL() correctly identified all Unix EOL.");
6565
// Test DOS
6666
$file = new TextFile(fopen($this->filename, 'rb'), TextFile::DOS);
6767
$values = array(FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE); // Includes EOF delimiter
@@ -74,7 +74,7 @@ class PHPLib_TextFile_TestCase extends DrupalUnitTestCase {
7474
}
7575
$file->seek(1, SEEK_CUR);
7676
}
77-
$this->assert($successful, "TextFile::EOL() Correctly identified all DOS EOL.");
77+
$this->assert($successful, "TextFile::EOL() correctly identified all DOS EOL.");
7878
// Test MAC
7979
$file = new TextFile(fopen($this->filename, 'rb'), TextFile::MAC);
8080
$values = array(FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE); // Includes EOF delimiter
@@ -87,7 +87,7 @@ class PHPLib_TextFile_TestCase extends DrupalUnitTestCase {
8787
}
8888
$file->seek(1, SEEK_CUR);
8989
}
90-
$this->assert($successful, "TextFile::EOL() Correctly identified all MAC EOL.");
90+
$this->assert($successful, "TextFile::EOL() correctly identified all MAC EOL.");
9191
unset($file); // Destroy the reference to the file.
9292
}
9393

@@ -101,14 +101,14 @@ class PHPLib_TextFile_TestCase extends DrupalUnitTestCase {
101101
$file->seek($i);
102102
if ($file->seekBeforeEOL() !== $values[$i]) {
103103
$successful = FALSE;
104-
$this->assert($successful, t('TextFile::seekBeforeEOL() incorrectly moved to "%actual" expected "%expected"', array(
104+
$this->assert($successful, t('TextFile::seekBeforeEOL() incorrectly moved to "%actual" (expected: "%expected")', array(
105105
'%actual' => $file->pos,
106106
'%expected' => $values[$i]))
107107
);
108108
break;
109109
}
110110
}
111-
$this->assert($successful, "TextFile::seekBeforeEOL() Correctly seeked before all EOL.");
111+
$this->assert($successful, "TextFile::seekBeforeEOL() correctly sought before all EOL.");
112112
unset($file); // Destroy the reference to the file.
113113
}
114114

@@ -122,14 +122,14 @@ class PHPLib_TextFile_TestCase extends DrupalUnitTestCase {
122122
$file->seek($i);
123123
if ($file->seekAfterEOL() !== $values[$i]) {
124124
$successful = FALSE;
125-
$this->assert($successful, t('TextFile::seekAfterEOL() incorrectly moved to "%actual" expected "%expected"', array(
125+
$this->assert($successful, t('TextFile::seekAfterEOL() incorrectly moved to "%actual" (expected: "%expected")', array(
126126
'%actual' => $file->pos,
127127
'%expected' => $values[$i]))
128128
);
129129
break;
130130
}
131131
}
132-
$this->assert($successful, "TextFile::seekAfterEOL() Correctly seeked after all EOL.");
132+
$this->assert($successful, "TextFile::seekAfterEOL() Correctly sought after all EOL.");
133133
unset($file); // Destroy the reference to the file.
134134
}
135135

@@ -143,14 +143,14 @@ class PHPLib_TextFile_TestCase extends DrupalUnitTestCase {
143143
$file->seek($i);
144144
if ($file->seekLineStart() !== $values[$i]) {
145145
$successful = FALSE;
146-
$this->assert($successful, t('TextFile::seekLineStart() incorrectly moved to "%actual" expected "%expected"', array(
146+
$this->assert($successful, t('TextFile::seekLineStart() incorrectly moved to "%actual" (expected: "%expected")', array(
147147
'%actual' => $file->pos,
148148
'%expected' => $values[$i]))
149149
);
150150
break;
151151
}
152152
}
153-
$this->assert($successful, "TextFile::seekLineStart() Correctly seeked after all EOL.");
153+
$this->assert($successful, "TextFile::seekLineStart() correctly sought after all EOL.");
154154
unset($file); // Destroy the reference to the file.
155155
}
156156

@@ -164,17 +164,17 @@ class PHPLib_TextFile_TestCase extends DrupalUnitTestCase {
164164
$file->seek($i);
165165
if ($file->seekLineEnd() !== $values[$i]) {
166166
$successful = FALSE;
167-
$this->assert($successful, t('TextFile::seekLineEnd() incorrectly moved to "%actual" expected "%expected"', array(
167+
$this->assert($successful, t('TextFile::seekLineEnd() incorrectly moved to "%actual" (expected: "%expected")', array(
168168
'%actual' => $file->pos,
169169
'%expected' => $values[$i]))
170170
);
171171
break;
172172
}
173173
}
174-
$this->assert($successful, "TextFile::seekLineEnd() Correctly seeked after all EOL.");
174+
$this->assert($successful, "TextFile::seekLineEnd() correctly sought after all EOL.");
175175
unset($file); // Destroy the reference to the file.
176176
}
177-
177+
178178
public function test_seekPrevLineEnd() {
179179
$content = "a|b\nc\r\nd";
180180
$this->writeToFile($content);
@@ -185,14 +185,14 @@ class PHPLib_TextFile_TestCase extends DrupalUnitTestCase {
185185
$file->seek($i);
186186
if ($file->seekLineEnd() !== $values[$i]) {
187187
$successful = FALSE;
188-
$this->assert($successful, t('TextFile::seekLineEnd() incorrectly moved to "%actual" expected "%expected"', array(
188+
$this->assert($successful, t('TextFile::seekLineEnd() incorrectly moved to "%actual" (expected: "%expected")', array(
189189
'%actual' => $file->pos,
190190
'%expected' => $values[$i]))
191191
);
192192
break;
193193
}
194194
}
195-
$this->assert($successful, "TextFile::seekLineEnd() Correctly seeked after all EOL.");
195+
$this->assert($successful, "TextFile::seekLineEnd() correctly sought after all EOL.");
196196
unset($file); // Destroy the reference to the file.
197197
}
198198

0 commit comments

Comments
 (0)