-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66f824a
commit b2791fe
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
use League\Flysystem\Adapter\Local; | ||
use League\Flysystem\Filesystem; | ||
use wappr\Logger; | ||
|
||
class InterpolateTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testInterpolate() | ||
{ | ||
$adapter = new Local(dirname(__DIR__).'/storage/logs/'); | ||
$filesystem = new Filesystem($adapter); | ||
$logger = new Logger($filesystem, Psr\Log\LogLevel::INFO); | ||
|
||
$values = [ | ||
'animal' => 'cat', | ||
]; | ||
|
||
$logger->info('A horse is a {animal}.', $values); | ||
|
||
$logs = $filesystem->read(date('Y-m-d').'.log'); // read the logs into a string | ||
|
||
$containsCat = false; | ||
|
||
if (strpos($logs, 'cat') !== false) { | ||
$containsCat = true; | ||
} | ||
|
||
$this->assertTrue($containsCat); | ||
} | ||
} |