✏️ 正在编辑: PropostaTest.php
路径:
/srv/systems_dir/yuppiecred-lidernegocios/tests/application/models/PropostaTest.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php use PHPUnit\Framework\TestCase; use PHPUnit\DbUnit\TestCaseTrait; class Model_PropostaTest extends TestCase { // use TestCaseTrait; static private $pdo = null; protected $object; private $conn = null; public function getConnection() { if ($this->conn === null) { if (self::$pdo == null) { self::$pdo = new PDO('mysql:host=192.168.0.5;dbname=yuppiecred', 'root', '1234'); } $this->conn = $this->createDefaultDBConnection(self::$pdo, 'yuppiecred'); } return $this->conn; } public function getDataSet() { return $this->createMySQLXMLDataSet(__DIR__ . '/yuppiecred.xml'); // return $this->createFlatXmlDataSet(__DIR__ . '/yuppiecred.xml'); } protected function setUp() { $this->object = new Model_DbTable_Contrato(); } protected function tearDown() { } public function testEfetivarProposta() { $this->assertEquals($this->object, array()); } public function testDataBaseConnection() { $this->getConnection()->createDataSet(array('tb_bancos')); $bancos = $this->getDataSet(); $queryTable = $this->getConnection()->createQueryTable( 'bancos', 'SELECT * FROM tb_bancos' ); $expectedTable = $this->getDataSet()->getTable('tb_bancos'); //Here we check that the table in the database matches the data in the XML file $this->assertTablesEqual($expectedTable, $queryTable); } }
💾 保存文件
← 返回文件管理器