Skip to content

Instantly share code, notes, and snippets.

@xosofox
Created October 17, 2011 20:51
Show Gist options
  • Save xosofox/1293760 to your computer and use it in GitHub Desktop.
Save xosofox/1293760 to your computer and use it in GitHub Desktop.
autoload config for PropelBundle tests with Symfony2
//had to add these prefixes to my autoload for the php-unit tests to run
//app/autoload.php
$loader->registerPrefixes(array(
'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
'Twig_' => __DIR__.'/../vendor/twig/lib',
'BaseObject' => __DIR__.'/../vendor/propel/runtime/lib/om',
'Persistent' => __DIR__.'/../vendor/propel/runtime/lib/om',
'Propel' => __DIR__.'/../vendor/propel/runtime/lib',
));
//MediaFileTest.php
<?php
namespace Xosofox\MedusaBundle\Tests\Model;
use \Xosofox\MedusaBundle\Model\MediaFile;
use \BaseObject;
class MediaFileTest extends \PHPUnit_Framework_TestCase
{
public function testAnalyse()
{
$f=new MediaFile();
$f->setFilepath("/var/wwwroot/medusa/mountpoint/Music/MP3 Unsorted/Aerosmith - I Dont Want To Miss A Thing.mp3");
$f->analyse();
$this->assertEquals("Aerosmith",$f->getArtist());
$this->assertEquals("I Don't Want To Miss A Thing",$f->getTitle());
}
}
@xosofox
Copy link
Author

xosofox commented Oct 18, 2011

Any idea/hint where to look for it? So I could try replicate the issue with a vanilla project and maybe create a fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment