Thanks to @tomas-tibensky suggestions I made some changes to my code and now fixtures are loaded as I want (I need to learn now how to delete it after test runs) but anyway here is the solution, since DB isn't updated then your need to run the command doctrine:schema:update --force
to update DB schema and then load the fixtures:
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase,
Doctrine\Common\DataFixtures\Loader,
Doctrine\Common\DataFixtures\Executor\ORMExecutor,
Doctrine\Common\DataFixtures\Purger\ORMPurger,
Symfony\Bundle\FrameworkBundle\Console\Application,
Symfony\Component\Console\Input\StringInput
Company\ApprovalBundle\Entity\CompanyHasWtax,
Company\RegisterCompanyBundle\Entity\Company,
Company\ApprovalBundle\DataFixtures\ORM\LoadFeeData;
class CommissionCompanyControllerTest extends WebTestCase {
private $em;
protected static $application;
public function setUp() {
static::$kernel = static::createKernel();
static::$kernel->boot();
$this->em = static::$kernel->getContainer()->get('doctrine')->getManager();
self::runCommand('doctrine:schema:update --force');
$loader = new Loader();
$loader->addFixture(new LoadFeeData());
$purger = new ORMPurger();
$executor = new ORMExecutor($this->em, $purger);
$executor->execute($loader->getFixtures());
}
protected static function runCommand($command) {
$command = sprintf('%s --quiet', $command);
return self::getApplication()->run(new StringInput($command));
}
protected static function getApplication() {
if (null === self::$application) {
$client = static::createClient();
self::$application = new Application($client->getKernel());
self::$application->setAutoExit(false);
}
return self::$application;
}
}