72. MathTest.php
<?php
require_once __DIR__ . '/Math.php';
class MathTest extends PHPUnit_Framework_TestCase
{
public function testSum()
{
}
}
73. MathTest.php
<?php
require_once __DIR__ . '/Math.php';
class MathTest extends PHPUnit_Framework_TestCase
{
public function testSum()
test {
}
}
74. MathTest.php
<?php
require_once __DIR__ . '/Math.php';
class MathTest extends PHPUnit_Framework_TestCase
{
test public function testSum()
{
CamelCase
}
}
75. MathTest.php
<?php
require_once __DIR__ . '/Math.php';
class MathTest extends PHPUnit_Framework_TestCase
{
public function testSum()
{
$this->assertEquals(55, Math::sum(1, 10));
PHPUnit $this->assertEquals(5050, Math::sum(1, 100));
assertions }
}
76. MathTest.php
<?php
require_once __DIR__ . '/Math.php';
class MathTest extends PHPUnit_Framework_TestCase
{
public function testSum()
{
$this->assertEquals(55, Math::sum(1, 10));
$this->assertEquals(5050, Math::sum(1, 100));
}
}
77. MathTest.php
<?php
require_once __DIR__ . '/Math.php';
class MathTest extends PHPUnit_Framework_TestCase
{
public function testSum()
{
$this->assertEquals(55, Math::sum(1, 10));
$this->assertEquals(5050, Math::sum(1, 100));
}
}
123. DbSelectTest.php
<?php
require_once dirname(dirname(__DIR__)) . '/library/DbSelect.php';
class DbSelectTest extends PHPUnit_Framework_TestCase
{
public function testFrom()
{
from
}
}
124. DbSelectTest.php
<?php
require_once dirname(dirname(__DIR__)) . '/library/DbSelect.php';
class DbSelectTest extends PHPUnit_Framework_TestCase
{
public function testFrom()
{
$select = new DbSelect();
$select->from('test');
$this->assertEquals('SELECT * FROM test',
$select->__toString());
}
}
125. DbSelect.php
<?php
DbSelect.php class DbSelect
{
}
126. DbSelect.php
<?php
class DbSelect
{
public function from($table)
from
{
}
}
127. DbSelect.php
<?php
class DbSelect
{
public function from($table)
{
}
public function __toString()
__toString
{
}
}
128. DbSelect.php
<?php
class DbSelect
{
public function from($table)
{
}
public function __toString()
{
return 'SELECT * FROM test';
}
}
131. DbSelect.php
<?php
class DbSelect
{
public function from($table)
{
}
public function __toString()
{
table
return 'SELECT * FROM ' . $this->_table;
}
}
132. DbSelect.php
<?php
class DbSelect
{
$_table protected $_table = 'table';
public function from($table)
{
}
public function __toString()
{
return 'SELECT * FROM ' . $this->_table;
}
}
133. DbSelect.php
<?php
class DbSelect
{
protected $_table = 'table';
public function from($table)
{
if (!preg_match('/[0-9a-z]+/i', $table)) {
throw new IllegalNameException('Illegal Table Name');
from
}
setter
$this->_table = $table;
return $this;
}
public function __toString()
{
return 'SELECT * FROM ' . $this->_table;
}
}
147. DbSelectTest.php
<?php
require_once dirname(dirname(__DIR__)) . '/library/DbSelect.php';
DbSelectTest.php class DbSelectTest extends PHPUnit_Framework_TestCase
{
public function testFrom()
{
$select = new DbSelect();
$select->from('test');
$this->assertEquals('SELECT * FROM test',
$select->__toString());
}
public function testCols()
{
$select = new DbSelect();
$select->from('test')->cols(array(
'col_a',
'col_b',
));
$this->assertEquals('SELECT col_a, col_b FROM test',
$select->__toString());
}
}
148. DbSelectTest.php
<?php
require_once dirname(dirname(__DIR__)) . '/library/DbSelect.php';
class DbSelectTest extends PHPUnit_Framework_TestCase
{
public function testFrom()
{
$select = new DbSelect();
$select->from('test');
$this->assertEquals('SELECT * FROM test',
$select->__toString());
}
new DbSelect() public function testCols()
{
$select = new DbSelect();
$select->from('test')->cols(array(
'col_a',
'col_b',
));
$this->assertEquals('SELECT col_a, col_b FROM test',
$select->__toString());
}
}
151. DbSelectTest.php
<?php
require_once dirname(dirname(__DIR__)) . '/library/DbSelect.php';
class DbSelectTest extends PHPUnit_Framework_TestCase
{
public function testFrom()
{
$select->from('test');
$this->assertEquals('SELECT * FROM test',
new DbSelect() $select->__toString());
}
public function testCols()
{
$select->from('test')->cols(array('col_a', 'col_b'));
$this->assertEquals('SELECT col_a, col_b FROM test',
$select->__toString());
}
}
152. DbSelectTest.php
<?php
require_once dirname(dirname(__DIR__)) . '/library/DbSelect.php';
class DbSelectTest extends PHPUnit_Framework_TestCase
{
fixture protected $_select;
public function testFrom()
{
$select->from('test');
$this->assertEquals('SELECT * FROM test',
$select->__toString());
}
public function testCols()
{
$select->from('test')->cols(array('col_a', 'col_b'));
$this->assertEquals('SELECT col_a, col_b FROM test',
$select->__toString());
}
}
153. DbSelectTest.php
<?php
require_once dirname(dirname(__DIR__)) . '/library/DbSelect.php';
class DbSelectTest extends PHPUnit_Framework_TestCase
{
protected $_select;
protected function setUp()
{
setUp $this->_select = new DbSelect();
fixture }
public function testFrom()
{
$select->from('test');
$this->assertEquals('SELECT * FROM test',
$select->__toString());
}
public function testCols()
{
$select->from('test')->cols(array('col_a', 'col_b'));
$this->assertEquals('SELECT col_a, col_b FROM test',
$select->__toString());
}
}
154. DbSelectTest.php
<?php
require_once dirname(dirname(__DIR__)) . '/library/DbSelect.php';
class DbSelectTest extends PHPUnit_Framework_TestCase
{
protected $_select;
protected function setUp()
{
$this->_select = new DbSelect();
}
public function testFrom()
{
$select->from('test');
$this->assertEquals('SELECT * FROM test',
$select->__toString());
}
public function testCols()
{
$select->from('test')->cols(array('col_a', 'col_b'));
$this->assertEquals('SELECT col_a, col_b FROM test',
$select->__toString());
}
protected function tearDown()
{
$this->_select = null;
tearDown
}
fixture }
155. DbSelectTest.php
<?php
require_once dirname(dirname(__DIR__)) . '/library/DbSelect.php';
class DbSelectTest extends PHPUnit_Framework_TestCase
{
protected $_select;
protected function setUp()
{
$this->_select = new DbSelect();
}
public function testFrom()
{
$this->_select->from('test');
$this->assertEquals('SELECT * FROM test',
$this->_select->__toString());
$select }
$this->_select
public function testCols()
{
$this->_select->from('test')->cols(array('col_a', 'col_b'));
$this->assertEquals('SELECT col_a, col_b FROM test',
$this->_select->__toString());
}
protected function tearDown()
{
$this->_select = null;
}
}