mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-04 14:07:25 +02:00
create a Test folder for each pattern
This commit is contained in:
23
Structural/FluentInterface/Tests/FluentInterfaceTest.php
Normal file
23
Structural/FluentInterface/Tests/FluentInterfaceTest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\Structural\FluentInterface\Tests;
|
||||
|
||||
use DesignPatterns\Structural\FluentInterface\Sql;
|
||||
|
||||
/**
|
||||
* FluentInterfaceTest tests the fluent interface SQL
|
||||
*/
|
||||
class FluentInterfaceTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
public function testBuildSQL()
|
||||
{
|
||||
$instance = new Sql();
|
||||
$query = $instance->select(array('foo', 'bar'))
|
||||
->from('foobar', 'f')
|
||||
->where('f.bar = ?')
|
||||
->getQuery();
|
||||
|
||||
$this->assertEquals('SELECT foo,bar FROM foobar AS f WHERE f.bar = ?', $query);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user