Skip to content

Commit

Permalink
Fixed unit tests after refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
camspiers committed Nov 25, 2013
1 parent a4a5ad1 commit b3e3f3a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
10 changes: 8 additions & 2 deletions tests/Camspiers/LoggerBridge/BasicBacktraceReporterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,14 @@ public function testGetExceptionBacktrace()
$reporter = new BasicBacktraceReporter();

$exception = new \Exception('Test');

$this->assertEquals($exception->getTrace(), $reporter->getBacktrace($exception));

$backtrace = $exception->getTrace();

foreach ($backtrace as $index => $backtraceCall) {
unset($backtrace[$index]['args']);
}

$this->assertEquals($backtrace, $reporter->getBacktrace($exception));
}

public function testGetGlobalBacktrace()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ public function testFilteredFunctionsBacktrace()

$exception = new \Exception('Test');

$this->assertEquals($exception->getTrace(), $reporter->getBacktrace($exception));
$backtrace = $exception->getTrace();

foreach ($backtrace as $index => $backtraceCall) {
unset($backtrace[$index]['args']);
}

$this->assertEquals($backtrace, $reporter->getBacktrace($exception));

$reporter = new FilteredBacktraceReporter(
$fns = array(
Expand Down
12 changes: 7 additions & 5 deletions tests/Camspiers/LoggerBridge/LoggerBridgeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,7 @@ public function testExceptionHandler()
'Uncaught Exception: Message',
$this->logicalAnd(
$this->contains($exception->getFile()),
$this->contains($exception->getLine()),
$this->contains('')
$this->contains($exception->getLine())
)
);

Expand Down Expand Up @@ -811,11 +810,14 @@ public function testPreRequest()
);

$bridge->expects($this->once())
->method('registerGlobalHandlers')
->with($request = $this->getMockWithoutConstructor('SS_HTTPRequest'), $model = $this->getMockWithoutConstructor('DataModel'));
->method('registerGlobalHandlers');

$this->assertTrue(
$bridge->preRequest($request, $this->getMockWithoutConstructor('Session'), $model)
$bridge->preRequest(
$this->getMockWithoutConstructor('SS_HTTPRequest'),
$this->getMockWithoutConstructor('Session'),
$this->getMockWithoutConstructor('DataModel')
)
);
}

Expand Down

0 comments on commit b3e3f3a

Please sign in to comment.