forked from phalcon/cphalcon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move unit-tests/ to tests/ (phalcon#12348)
* Removed $_POST from Validation unit tests. * Moved some more Validation unit tests to Codeception. * Moved some Form unit tests to Codeception. * Moved Models getter and setter unit tests to Codeception. * Moved Models Serialize unit tests to Codeception. * Moved Model Mass Assignment unit tests to Codeception. * Moved Model Finders unit tests to Codeception. * Moved View unit tests to Codeception. * Improved accuracy of timestamps in File Logger unit tests. * Moved Annotations Router unit tests to Codeception.
- Loading branch information
1 parent
6f002be
commit 9f10c26
Showing
30 changed files
with
1,298 additions
and
1,293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
class AboutController | ||
{ | ||
/** | ||
* @Get("/about/team") | ||
*/ | ||
public function teamAction() | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* @Post("/about/team") | ||
*/ | ||
public function teamPostAction() | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
class MainController | ||
{ | ||
/** | ||
* @Get("/") | ||
*/ | ||
public function indexAction() | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
class ProductsController | ||
{ | ||
/** | ||
* @Get("/products") | ||
*/ | ||
public function indexAction() | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* @Get("/products/edit/{id:[0-9]+}", name="edit-product") | ||
*/ | ||
public function editAction($id) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* @Route("/products/save", methods={"POST", "PUT"}, name="save-product") | ||
*/ | ||
public function saveAction() | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
/** | ||
* @RoutePrefix("/robots") | ||
*/ | ||
class RobotsController | ||
{ | ||
/** | ||
* @Get("/") | ||
*/ | ||
public function indexAction() | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* @Get("/edit/{id:[0-9]+}", name="edit-robot") | ||
*/ | ||
public function editAction($id) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* @Route("/save", methods={"POST", "PUT"}, name="save-robot") | ||
*/ | ||
public function saveAction() | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
namespace Phalcon\Test\Models\Boutique; | ||
|
||
class Robots extends \Phalcon\Mvc\Model | ||
{ | ||
|
||
const setterEpilogue = " setText"; | ||
|
||
/** | ||
* @Primary | ||
* @Identity | ||
* @Column(type="integer", nullable=false) | ||
*/ | ||
public $id; | ||
|
||
/** | ||
* @Column(type="string", length=70, nullable=false) | ||
*/ | ||
public $name; | ||
|
||
/** | ||
* @Column(type="string", length=32, nullable=false, default='mechanical') | ||
*/ | ||
public $type; | ||
|
||
/** | ||
* @Column(type="integer", nullable=false, default=1900) | ||
*/ | ||
public $year; | ||
|
||
/** | ||
* @Column(type="datetime", nullable=false) | ||
*/ | ||
public $datetime; | ||
|
||
/** | ||
* @Column(type="datetime", nullable=true) | ||
*/ | ||
public $deleted; | ||
|
||
/** | ||
* @Column(type="text", nullable=false) | ||
*/ | ||
protected $text; | ||
|
||
/** | ||
* Test restriction to not set hidden properties without setters. | ||
*/ | ||
protected $serial; | ||
|
||
public function getText() { | ||
return $this->text; | ||
} | ||
|
||
public function setText($value) { | ||
return ($this->text = $value . self::setterEpilogue); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Phalcon\Test\Models\Boutique; | ||
|
||
/** | ||
* Robotters | ||
* | ||
* "robotters" is robots in danish | ||
*/ | ||
class Robotters extends \Phalcon\Mvc\Model | ||
{ | ||
|
||
/** | ||
* @Primary | ||
* @Identity | ||
* @Column(type="integer", nullable=false, mappedColumn="id") | ||
*/ | ||
public $code; | ||
|
||
/** | ||
* @Column(type="string", length=70, nullable=false, mappedColumn="id") | ||
*/ | ||
public $theName; | ||
|
||
/** | ||
* @Column(type="string", length=32, nullable=false, mappedColumn="id") | ||
*/ | ||
public $theType; | ||
|
||
/** | ||
* @Column(type="integer", nullable=false, mappedColumn="id") | ||
*/ | ||
public $theYear; | ||
|
||
public function getSource() | ||
{ | ||
return 'robots'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Phalcon\Test\Models; | ||
|
||
/** | ||
* Deles | ||
* | ||
* Deles is "parts" in danish | ||
*/ | ||
class Deles extends \Phalcon\Mvc\Model | ||
{ | ||
|
||
public function getSource() | ||
{ | ||
return 'parts'; | ||
} | ||
|
||
public function columnMap() | ||
{ | ||
return array( | ||
'id' => 'code', | ||
'name' => 'theName', | ||
); | ||
} | ||
|
||
public function initialize() | ||
{ | ||
$this->hasMany( | ||
'code', | ||
RobottersDeles::class, | ||
'delesCode', | ||
array( | ||
'foreignKey' => array( | ||
'message' => 'Deles cannot be deleted because is referenced by a Robotter' | ||
) | ||
) | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Phalcon\Test\Models; | ||
|
||
/** | ||
* Robotters | ||
* | ||
* "robotters" is robots in danish | ||
*/ | ||
class Robotters extends \Phalcon\Mvc\Model | ||
{ | ||
|
||
public function getSource() | ||
{ | ||
return 'robots'; | ||
} | ||
|
||
public function columnMap() | ||
{ | ||
return array( | ||
'id' => 'code', | ||
'name' => 'theName', | ||
'type' => 'theType', | ||
'year' => 'theYear', | ||
'datetime' => 'theDatetime', | ||
'deleted' => 'theDeleted', | ||
'text' => 'theText' | ||
); | ||
} | ||
|
||
public function initialize() | ||
{ | ||
$this->hasMany( | ||
'code', | ||
RobottersDeles::class, | ||
'robottersCode', | ||
array( | ||
'foreignKey' => true | ||
) | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace Phalcon\Test\Models; | ||
|
||
/** | ||
* RobottersDeles | ||
* | ||
* This model is an intermediate table for "Robotters" and "Deles" | ||
*/ | ||
class RobottersDeles extends \Phalcon\Mvc\Model | ||
{ | ||
|
||
public function getSource() | ||
{ | ||
return 'robots_parts'; | ||
} | ||
|
||
public function columnMap() | ||
{ | ||
return array( | ||
'id' => 'code', | ||
'robots_id' => 'robottersCode', | ||
'parts_id' => 'delesCode', | ||
); | ||
} | ||
|
||
public function initialize() | ||
{ | ||
|
||
$this->belongsTo( | ||
'delesCode', | ||
Deles::class, | ||
'code', | ||
array( | ||
'foreignKey' => true | ||
) | ||
); | ||
|
||
$this->belongsTo( | ||
'robottersCode', | ||
Robotters::class, | ||
'code', | ||
array( | ||
'foreignKey' => array( | ||
'message' => 'The robotters code does not exist' | ||
) | ||
) | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div class="after-layout"><?php echo $this->getContent(); ?></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div class="before-layout"><?php echo $this->getContent(); ?></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div class="controller-layout"><?php echo $this->getContent(); ?></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div class="action">Action</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php echo isset($this->getView()->set_param); ?> |
Oops, something went wrong.