Skip to content

Commit

Permalink
🐛 fix tests #101
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Sep 17, 2019
1 parent 400893d commit 128c63d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
4 changes: 2 additions & 2 deletions tests/CreateControllersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public function testAddConstruct(){
$expected = array();
$expected[] = ESP.'private $dao = null;'.EOL;
$expected[] = EOL;
$expected[] = ESP.'public function __construct()'.EOL;
$expected[] = ESP.'public function __construct($tpdo = null)'.EOL;
$expected[] = ESP.'{'.EOL;
$expected[] = ESP.ESP.'$this->dao = new TestDAO();'.EOL;
$expected[] = ESP.ESP.'$this->dao = new TestDAO($tpdo);'.EOL;
$expected[] = ESP.'}'.EOL;

$this->create->addConstruct();
Expand Down
18 changes: 11 additions & 7 deletions tests/TCreateDAOTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function testAddSqlDelete() {
}

public function testAddConstruct_numLines(){
$expectedQtd = 14;
$expectedQtd = 26;

$this->create->addConstruct();
$resultArray = $this->create->getLinesArray();
Expand All @@ -212,8 +212,12 @@ public function testAddConstruct(){
$expected = array();
$expected[] = ESP.'private $tpdo = null;'.EOL;
$expected[] = EOL;
$expected[] = ESP.'public function __construct() {'.EOL;
$expected[] = ESP.ESP.'$tpdo = New TPDOConnectionObj();'.EOL;
$expected[] = ESP.'public function __construct($tpdo=null)'.EOL;
$expected[] = ESP.'{'.EOL;
$expected[] = ESP.ESP.'$this->validateObjType($tpdo);'.EOL;
$expected[] = ESP.ESP.'if( empty($tpdo) ){'.EOL;
$expected[] = ESP.ESP.ESP.'$tpdo = New TPDOConnectionObj();'.EOL;
$expected[] = ESP.ESP.'}'.EOL;
$expected[] = ESP.ESP.'$this->setTPDOConnection($tpdo);'.EOL;
$expected[] = ESP.'}'.EOL;
$expected[] = ESP.'public function getTPDOConnection()'.EOL;
Expand All @@ -230,7 +234,7 @@ public function testAddConstruct(){
}

public function testShow_VIEW_numLines(){
$expectedQtd = 92;
$expectedQtd = 104;

$this->create->setTableType(TableInfo::TB_TYPE_VIEW);
$resultArray = $this->create->show('array');
Expand All @@ -239,7 +243,7 @@ public function testShow_VIEW_numLines(){
}

public function testShow_VIEW_GRID_SQL_numLines(){
$expectedQtd = 105;
$expectedQtd = 117;

$this->create->setWithSqlPagination(GRID_SQL_PAGINATION);
$this->create->setTableType(TableInfo::TB_TYPE_VIEW);
Expand All @@ -249,7 +253,7 @@ public function testShow_VIEW_GRID_SQL_numLines(){
}

public function testShow_TABLE_numLines(){
$expectedQtd = 131;
$expectedQtd = 143;

$this->create->setTableType(TableInfo::TB_TYPE_TABLE);
$resultArray = $this->create->show('array');
Expand All @@ -258,7 +262,7 @@ public function testShow_TABLE_numLines(){
}

public function testShow_TABLE_GRID_SQL_numLines(){
$expectedQtd = 144;
$expectedQtd = 156;

$this->create->setTableType(TableInfo::TB_TYPE_TABLE);
$this->create->setWithSqlPagination(GRID_SQL_PAGINATION);
Expand Down
14 changes: 7 additions & 7 deletions tests/TCreateFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public function testAddButtons_Grid_Table(){
}

public function testShow_GridSimple_numlines(){
$expectedQtd = 22;
$expectedQtd = 23;

$this->create->setGridType(GRID_SIMPLE);
$this->create->setTableType(TableInfo::TB_TYPE_TABLE);
Expand Down Expand Up @@ -236,7 +236,7 @@ public function testAddGrid_GridSimple(){


public function testShow_GridSqlPaginator_numlines(){
$expectedQtd = 63;
$expectedQtd = 65;

$this->create->setGridType(GRID_SQL_PAGINATION);
$this->create->setTableType(TableInfo::TB_TYPE_TABLE);
Expand All @@ -248,7 +248,7 @@ public function testShow_GridSqlPaginator_numlines(){
}

public function testShow_GridScreenPaginator_numlines(){
$expectedQtd = 61;
$expectedQtd = 63;

$this->create->setGridType(GRID_SCREEN_PAGINATION);
$this->create->setTableType(TableInfo::TB_TYPE_TABLE);
Expand All @@ -260,7 +260,7 @@ public function testShow_GridScreenPaginator_numlines(){
}

public function testShow_VIEW_numLines(){
$expectedQtd = 99;
$expectedQtd = 101;

$this->create->setTableType(TableInfo::TB_TYPE_VIEW);
$resultArray = $this->create->show('array');
Expand All @@ -269,7 +269,7 @@ public function testShow_VIEW_numLines(){
}

public function testShow_VIEW_GridSqlPagination_numLines(){
$expectedQtd = 103;
$expectedQtd = 105;

$this->create->setGridType(GRID_SQL_PAGINATION);
$this->create->setTableType(TableInfo::TB_TYPE_VIEW);
Expand All @@ -279,15 +279,15 @@ public function testShow_VIEW_GridSqlPagination_numLines(){
}

public function testShow_TABLE_numLines(){
$expectedQtd = 98;
$expectedQtd = 100;

$resultArray = $this->create->show('array');
$size = CountHelper::count($resultArray);
$this->assertEquals( $expectedQtd, $size);
}

public function testShow_TABLE_GridSqlPagination_numLines(){
$expectedQtd = 102;
$expectedQtd = 104;

$this->create->setGridType(GRID_SQL_PAGINATION);
$resultArray = $this->create->show('array');
Expand Down

0 comments on commit 128c63d

Please sign in to comment.