File tree Expand file tree Collapse file tree 2 files changed +37
-17
lines changed
Expand file tree Collapse file tree 2 files changed +37
-17
lines changed Original file line number Diff line number Diff line change 1818namespace OpenCloud \Tests \Database ;
1919
2020use OpenCloud \Tests \OpenCloudTestCase ;
21- use OpenCloud \Common \Log \Logger ;
22-
23- class UnitTestLogger extends Logger
24- {
25- protected $ criticalLogMessage ;
26-
27- public function critical ($ message , array $ context = array ())
28- {
29- ++$ this ->criticalLogMessage ;
30- }
31-
32- public function getCriticalLogMessage ()
33- {
34- return $ this ->criticalLogMessage ;
35- }
36- }
21+ use OpenCloud \Tests \MockLogger ;
3722
3823class DatabaseTestCase extends OpenCloudTestCase
3924{
@@ -45,7 +30,7 @@ class DatabaseTestCase extends OpenCloudTestCase
4530 public function setupObjects ()
4631 {
4732 $ client = $ this ->getClient ();
48- $ client ->setLogger (new UnitTestLogger ());
33+ $ client ->setLogger (new MockLogger ());
4934 $ this ->service = $ client ->databaseService ();
5035
5136 $ this ->addMockSubscriber ($ this ->getTestFilePath ('Instance ' ));
Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright 2012-2014 Rackspace US, Inc.
4+ *
5+ * Licensed under the Apache License, Version 2.0 (the "License");
6+ * you may not use this file except in compliance with the License.
7+ * You may obtain a copy of the License at
8+ *
9+ * http://www.apache.org/licenses/LICENSE-2.0
10+ *
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
16+ */
17+
18+ namespace OpenCloud \Tests ;
19+
20+ use OpenCloud \Common \Log \Logger ;
21+
22+ class MockLogger extends Logger
23+ {
24+ protected $ criticalLogMessage ;
25+
26+ public function critical ($ message , array $ context = array ())
27+ {
28+ ++$ this ->criticalLogMessage ;
29+ }
30+
31+ public function getCriticalLogMessage ()
32+ {
33+ return $ this ->criticalLogMessage ;
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments