Skip to content

Instantly share code, notes, and snippets.

@cakephp-tutorial
Created February 26, 2016 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cakephp-tutorial/bf0159f1e529f096c1e6 to your computer and use it in GitHub Desktop.
Save cakephp-tutorial/bf0159f1e529f096c1e6 to your computer and use it in GitHub Desktop.
<?php
#file /app/Test/Case/Model/ContactTest.php
public function testGetAllContacts() {
//prendo i records dal modello
$result = $this->Contact->getAllContacts();
//questo è il risultato che mi aspetto
$exptected = array(
array('Contact' => array('id' => 1, 'name' => 'Walter', 'surname' => 'Raponi') ),
array('Contact' => array('id' => 2, 'name' => 'Emiliano', 'surname' => 'Merlin') ),
);
//qui verifico che i due array corrispondano
$this->assertEquals($exptected, $result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment