Development

#3483: sfPropelActAsTaggableBehavior_test-unit.patch

You must first sign up to be able to contribute.

Ticket #3483: sfPropelActAsTaggableBehavior_test-unit.patch

File sfPropelActAsTaggableBehavior_test-unit.patch, 1.5 kB (added by georgsorst, 2 weeks ago)

Fix for sfPropelActAsTaggableBehavior's unit tests

  • plugins/sfPropelActAsTaggableBehaviorPlugin/test/unit/sfPropelActAsTaggableBehaviorTest.php

    old new  
    44define('TEST_CLASS_2', 'Link'); 
    55 
    66// initializes testing framework 
    7 $sf_root_dir = realpath(dirname(__FILE__).'/../../../../'); 
     7$sf_root_dir = realpath(dirname(__FILE__).'/../../'); 
    88$apps_dir = glob($sf_root_dir.'/apps/*', GLOB_ONLYDIR); 
    99$app = substr($apps_dir[0], 
    1010              strrpos($apps_dir[0], DIRECTORY_SEPARATOR) + 1, 
     
    2525} 
    2626 
    2727// initialize database manager 
    28 $databaseManager = new sfDatabaseManager(); 
    29 $databaseManager->initialize(); 
    30 $con = Propel::getConnection(); 
     28sfContext::getInstance(); 
     29Propel::setConfiguration(sfPropelDatabase::getConfiguration()); 
     30Propel::initialize(); 
    3131 
    3232// clean the database 
    3333TagPeer::doDeleteAll(); 
     
    401401    throw new Exception(sprintf('Unknow class "%s"', $classname)); 
    402402  } 
    403403 
    404   return new $classname(); 
     404  $clazz = new $classname(); 
     405  $clazz->setTitle('test'); 
     406  return $clazz; 
    405407} 
    406408 
    407409// second type of test object creation 
     
    414416    throw new Exception(sprintf('Unknow class "%s"', $classname)); 
    415417  } 
    416418 
    417   return new $classname(); 
     419  $clazz = new $classname(); 
     420  $clazz->setTitle('test'); 
     421  return $clazz; 
    418422}