Commits

Arkadiusz Dzięgiel committed 143830a

fixed tests for php 5.3

Comments (0)

Files changed (2)

Tests/EventTriggeringTest.php

 	
 	public function testContainerSetting(){
 		
-		EventDispatcherProxy::setDispatcherGetter(function(){
-			$c = $this->getContainer();
+		$that = $this;
+		
+		EventDispatcherProxy::setDispatcherGetter(function() use ($that){
+			$c = $that->getContainer();
 			$d = new ContainerAwareEventDispatcher($c);
 			
 			$d->addListener('model.construct', array(new ContainerAwareModel($c), 'onModelConstruct'));
 			$triggered->{$e} = 0;
 		}
 		
-		EventDispatcherProxy::setDispatcherGetter(function() use (&$triggered, $events){
-			$c = $this->getContainer();
+		$that = $this;
+		
+		EventDispatcherProxy::setDispatcherGetter(function() use ($that, &$triggered, $events){
+			$c = $that->getContainer();
 			$d = new ContainerAwareEventDispatcher($c);
 				
 			foreach($events as $e){

Tests/PropelExtendingTest.php

 	static protected $extendedClass = 'Glorpen\Propel\PropelBundle\Tests\Fixtures\Model\ExtendedBook';
 	static protected $modelClass = 'Glorpen\Propel\PropelBundle\Tests\Fixtures\Model\Book';
 	
-	static protected $map;
+	static public $map;
 	
 	protected function setUpListener(){
-		EventDispatcherProxy::setDispatcherGetter(function(){
-			$c = $this->getContainer();
+		$that = $this;
+		EventDispatcherProxy::setDispatcherGetter(function() use ($that){
+			$c = $that->getContainer();
 			$d = new ContainerAwareEventDispatcher($c);
 				
-			$d->addListener('om.detect', array(new OMClassOverrider(self::$map), 'onDetectionRequest'));
+			$d->addListener('om.detect', array(new OMClassOverrider(PropelExtendingTest::$map), 'onDetectionRequest'));
 				
 			return $d;
 		});