Author: Derick Rethans
Date: 2007-05-04 08:52:55 +0200 (Fri, 04 May 2007)
New Revision: 5035
Log:
- Implemented issue #10592: Add tests for passing more parameters to a slot
then the slot function accepts.
Modified:
trunk/SignalSlot/ChangeLog
trunk/SignalSlot/tests/signal_collection_test.php
trunk/SignalSlot/tests/test_classes.php
Modified: trunk/SignalSlot/ChangeLog
===================================================================
--- trunk/SignalSlot/ChangeLog 2007-05-04 05:50:20 UTC (rev 5034)
+++ trunk/SignalSlot/ChangeLog 2007-05-04 06:52:55 UTC (rev 5035)
@@ -3,7 +3,9 @@
- Implemented issue #9965: Support for delayed initialization through
ezcBaseInit.
-- Implemented issue #10418: SignalSlot should support checking for a signal
+- Implemented issue #10418: SignalSlot should support checking for a signal.
+- Implemented issue #10592: Add tests for passing more parameters to a slot
+ then the slot function accepts.
1.0 - Monday 18 December 2006
Modified: trunk/SignalSlot/tests/signal_collection_test.php
===================================================================
--- trunk/SignalSlot/tests/signal_collection_test.php 2007-05-04 05:50:20 UTC
(rev 5034)
+++ trunk/SignalSlot/tests/signal_collection_test.php 2007-05-04 06:52:55 UTC
(rev 5035)
@@ -67,6 +67,20 @@
$this->assertEquals( array( "awaysorrowmoney" ),
$this->receiver->stack );
}
+ public function testSingleSignalsZeroOrMoreParamsNoPri()
+ {
+ $this->giver->signals->connect( "signal", array( $this->receiver,
"slotZeroOrMoreParams" ) );
+ $this->giver->signals->emit( "signal", "A", "great", "day",
"comrades,", "we", "sail", "into", "history!" );
+ $this->assertEquals( array( "A great day comrades, we sail into
history!" ), $this->receiver->stack );
+ }
+
+ public function testSingleSignalsOneOrMoreParamsNoPri()
+ {
+ $this->giver->signals->connect( "signal", array( $this->receiver,
"slotOneOrMoreParams" ) );
+ $this->giver->signals->emit( "signal", "Understanding", "is", "a",
"three-edged", "sword." );
+ $this->assertEquals( array( "Understanding is a three-edged sword." ),
$this->receiver->stack );
+ }
+
public function testThreeSignalsNoParamNoPri()
{
$this->giver->signals->connect( "signal1", array( $this->receiver,
"slotNoParams1" ) );
Modified: trunk/SignalSlot/tests/test_classes.php
===================================================================
--- trunk/SignalSlot/tests/test_classes.php 2007-05-04 05:50:20 UTC (rev
5034)
+++ trunk/SignalSlot/tests/test_classes.php 2007-05-04 06:52:55 UTC (rev
5035)
@@ -86,6 +86,18 @@
array_push( $this->stack, "{$param1}{$param2}{$param3}" );
}
+ public function slotZeroOrMoreParams()
+ {
+ $params = func_get_args();
+ array_push( $this->stack, join( ' ', $params ) );
+ }
+
+ public function slotOneOrMoreParams( $param1 )
+ {
+ $params = func_get_args();
+ array_push( $this->stack, join( ' ', $params ) );
+ }
+
public static function slotStatic()
{
self::$staticFunctionRun = "have a cigar";
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components