@@ 50-59 (lines=10) @@ | ||
47 | * |
|
48 | * @return void |
|
49 | */ |
|
50 | public function logWithInterpolation() |
|
51 | { |
|
52 | $collectionMock = $this->getMongoCollectionMockWithAsserts( |
|
53 | LogLevel::INFO, |
|
54 | 'user chadicus created', |
|
55 | ['username' => 'chadicus'], |
|
56 | null |
|
57 | ); |
|
58 | (new MongoLogger($collectionMock))->log(LogLevel::INFO, 'user {username} created', ['username' => 'chadicus']); |
|
59 | } |
|
60 | ||
61 | /** |
|
62 | * Verify behavior of log() when $level is not known. |
|
@@ 103-116 (lines=14) @@ | ||
100 | * |
|
101 | * @return void |
|
102 | */ |
|
103 | public function logObjectMessage() |
|
104 | { |
|
105 | $collectionMock = $this->getMongoCollectionMockWithAsserts( |
|
106 | LogLevel::INFO, |
|
107 | __FILE__, |
|
108 | ['foo' => 'bar'], |
|
109 | null |
|
110 | ); |
|
111 | (new MongoLogger($collectionMock))->log( |
|
112 | LogLevel::INFO, |
|
113 | new \SplFileInfo(__FILE__), |
|
114 | ['foo' => 'bar'] |
|
115 | ); |
|
116 | } |
|
117 | ||
118 | /** |
|
119 | * Verify context is normalized when log(). |