Author: bschussek
Date: 2010-02-17 17:31:45 +0100 (Wed, 17 Feb 2010)
New Revision: 28092
Modified:
tools/lime/branches/2.0/lib/mock/LimeMock.php
tools/lime/branches/2.0/lib/mock/template/mocked_class.tpl
tools/lime/branches/2.0/test/unit/LimeTestRunnerTest.php
tools/lime/branches/2.0/test/unit/mock/LimeMockStrictTest.php
tools/lime/branches/2.0/test/unit/mock/LimeMockTest.php
tools/lime/branches/2.0/test/unit/output/LimeOutputSuiteTest.php
tools/lime/branches/2.0/test/unit/output/LimeOutputTapTest.php
Log:
Renamed mock method any() to method()
Modified: tools/lime/branches/2.0/lib/mock/LimeMock.php
===================================================================
--- tools/lime/branches/2.0/lib/mock/LimeMock.php 2010-02-17 16:25:59 UTC
(rev 28091)
+++ tools/lime/branches/2.0/lib/mock/LimeMock.php 2010-02-17 16:31:45 UTC
(rev 28092)
@@ -316,7 +316,7 @@
* @param string $methodName
* @return LimeMockInvocationExpectation
*/
- public static function any(LimeMockInterface $mock, $methodName)
+ public static function method(LimeMockInterface $mock, $methodName)
{
return $mock->__call($methodName, null);
}
Modified: tools/lime/branches/2.0/lib/mock/template/mocked_class.tpl
===================================================================
--- tools/lime/branches/2.0/lib/mock/template/mocked_class.tpl 2010-02-17
16:25:59 UTC (rev 28091)
+++ tools/lime/branches/2.0/lib/mock/template/mocked_class.tpl 2010-02-17
16:31:45 UTC (rev 28092)
@@ -83,7 +83,7 @@
<?php if ($generate_controls): ?>
public function replay() { return LimeMock::replay($this); }
- public function any($methodName) { return LimeMock::any($this, $methodName);
}
+ public function method($methodName) { return LimeMock::method($this,
$methodName); }
public function reset() { return LimeMock::reset($this); }
public function verify() { return LimeMock::verify($this); }
public function setExpectNothing() { return
LimeMock::setExpectNothing($this); }
Modified: tools/lime/branches/2.0/test/unit/LimeTestRunnerTest.php
===================================================================
--- tools/lime/branches/2.0/test/unit/LimeTestRunnerTest.php 2010-02-17
16:25:59 UTC (rev 28091)
+++ tools/lime/branches/2.0/test/unit/LimeTestRunnerTest.php 2010-02-17
16:31:45 UTC (rev 28092)
@@ -117,8 +117,8 @@
$r->addExceptionHandler(array($mock, 'handleExceptionFailed'));
$r->addExceptionHandler(array($mock, 'handleExceptionSuccessful'));
$mock->testThrowsException()->throws('Exception');
- $mock->any('handleExceptionFailed')->returns(false);
- $mock->any('handleExceptionSuccessful')->returns(true);
+ $mock->method('handleExceptionFailed')->returns(false);
+ $mock->method('handleExceptionSuccessful')->returns(true);
$mock->replay();
// test
$r->run();
@@ -134,7 +134,7 @@
$r->addTest(array($mock, 'testThrowsException'));
$r->addExceptionHandler(array($mock, 'handleExceptionFailed'));
$mock->testThrowsException()->throws('Exception');
- $mock->any('handleExceptionFailed')->returns(false);
+ $mock->method('handleExceptionFailed')->returns(false);
$mock->replay();
// test
$t->expect('Exception');
Modified: tools/lime/branches/2.0/test/unit/mock/LimeMockStrictTest.php
===================================================================
--- tools/lime/branches/2.0/test/unit/mock/LimeMockStrictTest.php
2010-02-17 16:25:59 UTC (rev 28091)
+++ tools/lime/branches/2.0/test/unit/mock/LimeMockStrictTest.php
2010-02-17 16:31:45 UTC (rev 28092)
@@ -48,7 +48,7 @@
// @Test: ->verify() passes if a method is expected both with any and with
concrete parameters
// test
- $m->any('testMethod')->once();
+ $m->method('testMethod')->once();
$m->testMethod(1, 'foobar');
$m->replay();
$m->testMethod('ramble on');
Modified: tools/lime/branches/2.0/test/unit/mock/LimeMockTest.php
===================================================================
--- tools/lime/branches/2.0/test/unit/mock/LimeMockTest.php 2010-02-17
16:25:59 UTC (rev 28091)
+++ tools/lime/branches/2.0/test/unit/mock/LimeMockTest.php 2010-02-17
16:31:45 UTC (rev 28092)
@@ -591,7 +591,7 @@
// @Test: - Case 1: Correct parameters
// test
- $m->any('testMethod');
+ $m->method('testMethod');
$m->replay();
$m->testMethod();
$m->verify();
@@ -602,7 +602,7 @@
// @Test: - Case 1: "Wrong" parameters
// test
- $m->any('testMethod');
+ $m->method('testMethod');
$m->replay();
$m->testMethod(1, 2, 3);
$m->verify();
@@ -688,7 +688,7 @@
$m->testMethod();
-// @Test: ->any() always passes, regardless of how often a method was called
+// @Test: ->method() always passes, regardless of how often a method was called
// @Test: - Case 1: No actual call
@@ -744,7 +744,7 @@
// @Test: - Case 1: Comparison fails
// fixture
- $m->any('testMethod')->parameter(2)->is('foo');
+ $m->method('testMethod')->parameter(2)->is('foo');
$m->replay();
$t->expect('LimeMockException');
// test
@@ -754,7 +754,7 @@
// @Test: - Case 2: Comparison passes
// fixture
- $m->any('testMethod')->parameter(2)->is('foo');
+ $m->method('testMethod')->parameter(2)->is('foo');
$m->replay();
$m->testMethod(1, 'foo');
$m->verify();
@@ -766,7 +766,7 @@
// @Test: - Case 3: Parameter offset is out of range
// fixture
- $m->any('testMethod')->parameter(2)->is('foo');
+ $m->method('testMethod')->parameter(2)->is('foo');
$m->replay();
$t->expect('LimeMockException');
// test
@@ -859,7 +859,7 @@
// fixtures
TestCallbackClass::$arguments = null;
// test
- $m->any('testMethod')->callback(array('TestCallbackClass', 'callback'));
+ $m->method('testMethod')->callback(array('TestCallbackClass', 'callback'));
$m->replay();
$value = $m->testMethod(1, 'foobar');
// assertions
Modified: tools/lime/branches/2.0/test/unit/output/LimeOutputSuiteTest.php
===================================================================
--- tools/lime/branches/2.0/test/unit/output/LimeOutputSuiteTest.php
2010-02-17 16:25:59 UTC (rev 28091)
+++ tools/lime/branches/2.0/test/unit/output/LimeOutputSuiteTest.php
2010-02-17 16:31:45 UTC (rev 28092)
@@ -57,7 +57,7 @@
$file = new LimeFile('path');
$file->addLabels(array('label1', 'label2'));
$loader = $t->stub('LimeLoader');
- $loader->any('getFileByPath')->returns($file);
+ $loader->method('getFileByPath')->returns($file);
$loader->replay();
$output->setLoader($loader);
// test
@@ -73,7 +73,7 @@
// fixtures
$printer->printText(str_pad('script', 73, '.'));
$printer->printLine("not ok", LimePrinter::NOT_OK);
- $printer->any('printLine')->times(4);
+ $printer->method('printLine')->times(4);
$printer->printLine(' ... and 1 more');
$printer->replay();
// test
@@ -92,7 +92,7 @@
// fixtures
$printer->printText(str_pad('script', 73, '.'));
$printer->printLine("warning", LimePrinter::WARNING);
- $printer->any('printLine')->times(4);
+ $printer->method('printLine')->times(4);
$printer->printLine(' ... and 1 more');
$printer->replay();
// test
@@ -112,7 +112,7 @@
// fixtures
$printer->printText(str_pad('script', 73, '.'));
$printer->printLine("not ok", LimePrinter::NOT_OK);
- $printer->any('printLine')->times(4);
+ $printer->method('printLine')->times(4);
$printer->printLine(' ... and 1 more');
$printer->replay();
// test
@@ -132,7 +132,7 @@
// fixtures
$printer->printText(str_pad('script', 73, '.'));
$printer->printLine("ok", LimePrinter::OK);
- $printer->any('printLine')->times(4);
+ $printer->method('printLine')->times(4);
$printer->printLine(' ... and 1 more');
$printer->replay();
// test
@@ -152,7 +152,7 @@
// fixtures
$printer->printText(str_pad('script', 73, '.'));
$printer->printLine("not ok", LimePrinter::NOT_OK);
- $printer->any('printLine')->once();
+ $printer->method('printLine')->once();
$printer->printLine(' Looks like you planned 2 tests but only ran 1.');
$printer->replay();
// test
@@ -169,7 +169,7 @@
// fixtures
$printer->printText(str_pad('script', 73, '.'));
$printer->printLine("not ok", LimePrinter::NOT_OK);
- $printer->any('printLine')->once();
+ $printer->method('printLine')->once();
$printer->printLine(' Looks like you only planned 1 tests but ran 2.');
$printer->replay();
// test
@@ -186,8 +186,8 @@
// fixtures
$printer = $t->mock('LimePrinter'); // non-strict
- $printer->any('printText')->atLeastOnce();
- $printer->any('printLine')->atLeastOnce();
+ $printer->method('printText')->atLeastOnce();
+ $printer->method('printLine')->atLeastOnce();
$printer->printBox(' Failed 2/4 test scripts, 50.00% okay. 1/5 subtests
failed, 80.00% okay.', LimePrinter::NOT_OK);
$printer->replay();
$output = new LimeOutputSuite($printer, $configuration);
@@ -219,8 +219,8 @@
// fixtures
$printer = $t->mock('LimePrinter'); // non-strict
- $printer->any('printText')->atLeastOnce();
- $printer->any('printLine')->atLeastOnce();
+ $printer->method('printText')->atLeastOnce();
+ $printer->method('printLine')->atLeastOnce();
$printer->printBox(' All tests successful.', LimePrinter::HAPPY);
$printer->printBox(' Files=2, Tests=3, Time=00:01, Processes=3',
LimePrinter::HAPPY);
$printer->replay();
Modified: tools/lime/branches/2.0/test/unit/output/LimeOutputTapTest.php
===================================================================
--- tools/lime/branches/2.0/test/unit/output/LimeOutputTapTest.php
2010-02-17 16:25:59 UTC (rev 28091)
+++ tools/lime/branches/2.0/test/unit/output/LimeOutputTapTest.php
2010-02-17 16:31:45 UTC (rev 28092)
@@ -213,8 +213,8 @@
// fixtures
$printer->printLargeBox("Error: A very important error\n(in /test/file on
line 11)", LimePrinter::ERROR);
$printer->printLine('Exception trace:', LimePrinter::COMMENT);
- $printer->any('printText')->atLeastOnce();
- $printer->any('printLine')->atLeastOnce();
+ $printer->method('printText')->atLeastOnce();
+ $printer->method('printLine')->atLeastOnce();
$printer->replay();
// test
$output->error(new LimeError('A very important error', '/test/file', 11));
@@ -230,8 +230,8 @@
$configuration->replay();
$printer->printLargeBox("Error: A very important error\n(in /file on line
11)", LimePrinter::ERROR);
$printer->printLine('Exception trace:', LimePrinter::COMMENT);
- $printer->any('printText')->atLeastOnce();
- $printer->any('printLine')->atLeastOnce();
+ $printer->method('printText')->atLeastOnce();
+ $printer->method('printLine')->atLeastOnce();
$printer->replay();
// test
$output->error(new LimeError('A very important error', '/test/file', 11));
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.