Skip to content

Commit e47fa0f

Browse files
committed
make find command case insensitive
1 parent c507d6d commit e47fa0f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Commands/FindCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private function tableRows()
9393
$lines = $filesContent[$fileName][$languageKey] = Arr::dot($this->manager->getFileContent($filePath));
9494

9595
foreach ($lines as $key => $line) {
96-
if (! is_array($line) && Str::contains($line, $this->argument('keyword'))) {
96+
if (! is_array($line) && stripos($line, $this->argument('keyword')) !== false) {
9797
$output[$fileName.'.'.$key][$languageKey] = "<bg=yellow;fg=black>{$line}</>";
9898
}
9999
}

tests/FindCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ public function testCommandErrorOnFilesNotFound()
1717
public function testCommandOutputForFile()
1818
{
1919
$this->createTempFiles([
20-
'en' => ['user' => "<?php\n return ['not_found' => 'user not found', 'age' => 'Age'];"],
20+
'en' => ['user' => "<?php\n return ['not_found' => 'User NoT fOunD', 'age' => 'Age'];"],
2121
'nl' => ['user' => "<?php\n return ['not_found' => 'something'];"],
2222
'sp' => ['user' => "<?php\n return ['else' => 'else'];"],
2323
]);
2424

2525
$this->artisan('langman:find', ['keyword' => 'not found']);
2626

2727
$this->assertRegExp('/key(?:.*)en(?:.*)nl/', $this->consoleOutput());
28-
$this->assertRegExp('/user\.not_found(?:.*)user not found(?:.*)something/', $this->consoleOutput());
28+
$this->assertRegExp('/user\.not_found(?:.*)User NoT fOunD(?:.*)something/', $this->consoleOutput());
2929
$this->assertNotContains('age', $this->consoleOutput());
3030
$this->assertNotContains('else', $this->consoleOutput());
3131
}

0 commit comments

Comments
 (0)