propel-bundle/Tests/Command/AbstractPropelCommandTest.php
William DURAND 0b85aba836 [Command] Added a new command named: propel:form:generate
Allows to quickly create Form Type stubs
Added a PropelGeneratorAwareCommand class (abstract) to write more code generation based commands
Added few tests, fixed some tests as well
2012-04-11 12:00:19 +02:00

46 lines
1 KiB
PHP

<?php
/**
* This file is part of the PropelBundle package.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @license MIT License
*/
namespace Propel\PropelBundle\Tests\Command;
use Propel\PropelBundle\Tests\TestCase;
use Propel\PropelBundle\Command\AbstractPropelCommand;
/**
* @author William Durand <william.durand1@gmail.com>
*/
class AbstractPropelCommandTest extends TestCase
{
protected $command;
public function setUp()
{
$this->command = new TestableAbstractPropelCommand('testable-command');
}
public function testParseDbName()
{
$dsn = 'mydsn#dbname=foo';
$this->assertEquals('foo', $this->command->parseDbName($dsn));
}
public function testParseDbNameWithoutDbName()
{
$this->assertNull($this->command->parseDbName('foo'));
}
}
class TestableAbstractPropelCommand extends AbstractPropelCommand
{
public function parseDbName($dsn)
{
return parent::parseDbName($dsn);
}
}