Where are these PHP unit test configuration settings? I'm having some major problems with Doctrine/symofny and PHPUnit.
I set up a fixture file,load it, run a test. tear down the database, reload the database. Start the new test, run it, and just before the doctrine connection- >commit, the objects have all the right data. AFTER the commit, the foreign key index is right, but the relationhip for that index is one of the objects is always from the PREVIOUS test. So the relationhsip and the index disagree. And I do execute '$record- >refreshRelated(); Before anyone asks, I $record->free() EVERYTHING and set everything to null at the end of each test, exiting to the teardown/setup routing. Haven't checked on the query objects yet. I also set everything like this page says at the bottom: file:///home/yept/Desktop/Project/GoodSymfonyDesign/webPages/SPEEDING%20UP%20SYMFONY-%20symfony%201.3%20and%201.4%20=%3E%20Mass%20insert%20with%20doctrine.html Made no difference. I'm about ready to go back to PDO and only use Symonfy for filtering and display. On Jul 1, 5:30 am, Robert Schoenthal <[email protected]> wrote: > solved it by disabling processIsolation ofphpunit, it seems > backupGlobals and processIsolation dont fit well together... > > On Jul 1, 11:04 am, Robert Schoenthal <[email protected]> wrote: > > > He Folks, > > > dont know if anyone can help me here. > > i used the sfPhpUnit2Plugin for integratingphpunitinto symfony 1.4. > > > ich have a strange Problem with myphpunitTests: > > > The TestFile: > > > <?php > > require_once dirname(__FILE__).'/../bootstrap/unit.php'; > > > class unit_FooTest extends sfPHPUnitBaseTestCase > > { > > public function testInValidData() > > { > > //test some things > > } > > > public function _start() > > { > > new > > sfDatabaseManager(ProjectConfiguration::getApplicationConfiguration('tms', > > 'test', true)); > > $con = Propel::getConnection(); > > } > > > public function _end(){ > > Propel::close(); > > } > > > } > > > If i run the test standalone, everything works fine, but if i run all > > my tests in hudson, things are getting strange. > > > Myphpunit.xml: > > > <?xml version="1.0" encoding="UTF-8"?> > > > <phpunitbackupGlobals="false" > > backupStaticAttributes="false" > > colors="false" > > convertErrorsToExceptions="true" > > convertNoticesToExceptions="true" > > convertWarningsToExceptions="true" > > processIsolation="true" > > stopOnFailure="false" > > syntaxCheck="false"> > > <filter> > > <!-- --> > > </filter> > > > <logging> > > <log type="coverage-html" target="./doc/coverage" charset="UTF-8" > > yui="true" highlight="true" > > lowUpperBound="35" highLowerBound="70"/> > > <log type="coverage-xml" target="./log/clover-report.xml"/> > > <log type="test-xml" target="./log/phpunit-results.xml" /> > > </logging> > > > </phpunit> > > > Now if hudson trys to execute all tests, i get different errors > > regarding PDO. > > > 4) unit_FooTest::testInValidData > > RuntimeException: PDOException: You cannot serialize or unserialize > > PDO instances in /var/lib/hudson/jobs/Project/workspace/trunk/- on > > line 28 > > > i've read thephpunitdocumentation and found out that should have > > todo with the option "backupGlobals" set to true, but mine is false. > > I've tried different approaches, but nothing worked for me, has > > anybody ran into the same behavior, and has a solution? > > Why is the Propel Connection GLOBAL and whyphpunittried to serialize/ > > deserialize it, even when i explicitly close the connection. > > > I know Databases shouldnt be used in tests, but sometimes there is no > > other way (e.g. testing Peer Classes) > > > Anybody?!?!?! > > I really need a helping hand on this. > > > Cheerz > > Robert > > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" 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-users?hl=en
