From 46b5f25e75e0b5582c8f72e842417457675f967b Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 3 Aug 2012 17:15:22 +0200 Subject: [PATCH] assert call type --- tests/callnotifier/CallMonitorTest.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/callnotifier/CallMonitorTest.php b/tests/callnotifier/CallMonitorTest.php index 309a5e6..902a6c2 100644 --- a/tests/callnotifier/CallMonitorTest.php +++ b/tests/callnotifier/CallMonitorTest.php @@ -38,9 +38,11 @@ class CallMonitorTest extends \PHPUnit_Framework_TestCase implements Logger $this->loadDump('intern-22-zu-41.bin'); $this->assertCallCount(1, 1); + $this->assertOutgoing($this->calls['startingCall'][0]); $this->assertFrom('22', $this->calls['startingCall'][0]); $this->assertTo('**41', $this->calls['startingCall'][0]); + $this->assertOutgoing($this->calls['finishedCall'][0]); $this->assertFrom('22', $this->calls['finishedCall'][0]); $this->assertTo('**41', $this->calls['finishedCall'][0]); } @@ -50,9 +52,11 @@ class CallMonitorTest extends \PHPUnit_Framework_TestCase implements Logger $this->loadDump('intern-analog-zu-handy.bin'); $this->assertCallCount(1, 1); + $this->assertOutgoing($this->calls['startingCall'][0]); $this->assertFrom('40862', $this->calls['startingCall'][0]); $this->assertTo('01634779878', $this->calls['startingCall'][0]); + $this->assertOutgoing($this->calls['finishedCall'][0]); $this->assertFrom('40862', $this->calls['finishedCall'][0]); $this->assertTo('01634779878', $this->calls['finishedCall'][0]); } @@ -62,9 +66,11 @@ class CallMonitorTest extends \PHPUnit_Framework_TestCase implements Logger $this->loadDump('handy-zu-gruppe.bin'); $this->assertCallCount(1, 1); + $this->assertIncoming($this->calls['startingCall'][0]); $this->assertFrom('01634779878', $this->calls['startingCall'][0]); $this->assertTo('40862', $this->calls['startingCall'][0]); + $this->assertIncoming($this->calls['finishedCall'][0]); $this->assertFrom('01634779878', $this->calls['finishedCall'][0]); $this->assertTo('40862', $this->calls['finishedCall'][0]); } @@ -97,6 +103,22 @@ class CallMonitorTest extends \PHPUnit_Framework_TestCase implements Logger ); } + protected function assertIncoming(CallMonitor_Call $call) + { + $this->assertSame( + CallMonitor_Call::INCOMING, $call->type, + 'Call should be "incoming"' + ); + } + + protected function assertOutgoing(CallMonitor_Call $call) + { + $this->assertSame( + CallMonitor_Call::OUTGOING, $call->type, + 'Call should be "outgoing"' + ); + } + } ?> -- 2.30.2