From 52305370416666cbb7041bc5ba34578548ad8f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draic=20Brady?= Date: Sat, 28 Jan 2012 15:29:15 +0000 Subject: [PATCH] Added test and travis config --- .travis.yml | 9 +++++++++ tests/Mockery/ExpectationTest.php | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..eca37e8e0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: php +php: + - 5.3 + - 5.4 +before-script: + - pyrus channel-discover hamcrest.googlecode.com/svn/pear + - pyrus install hamcrest/Hamcrest + - phpenv rehash +script: phpunit --coverage-text \ No newline at end of file diff --git a/tests/Mockery/ExpectationTest.php b/tests/Mockery/ExpectationTest.php index 6a4685a3e..a36923365 100644 --- a/tests/Mockery/ExpectationTest.php +++ b/tests/Mockery/ExpectationTest.php @@ -1588,6 +1588,25 @@ public function testMockingDemeterChainsPassesMockeryExpectationToCompositeExpec $demeter = new Mockery_UseDemeter($mock); $this->assertSame('Spam!', $demeter->doit()); } + + /** + * @expectedException PHPUnit_Framework_Error_Warning + */ + public function testPregMatchThrowsDelimiterWarningWithXdebugScreamTurnedOn() + { + if (!extension_loaded('xdebug')) { + $this->markTestSkipped('ext/xdebug not installed'); + } + + if (ini_get('xdebug.scream') == 0) { + $this->markTestSkipped('xdebug.scream turned off'); + } + + $mock = $this->container->mock('foo'); + $mock->shouldReceive('foo')->with('bar', 'baz'); + + $mock->foo('spam', 'ham'); + } } class MockeryTest_InterMethod1