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
<?php | |
#file /app/Model/Contact.php | |
public function getAllContacts() { | |
return $this->find('all'); | |
} |
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
<?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') ), |
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
<?php | |
#file /app/Test/Case/Model/ContactTest.php | |
App::uses('Contact', 'Model'); | |
class ContactTest extends CakeTestCase { | |
public $fixtures = array('app.contact'); | |
public function setup() { | |
parent::setup(); | |
$this->Contact = ClassRegistry::init('Contact'); | |
} |
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
<?php | |
#file /app/Test/Fixture/ContactFixture.php | |
class ContactFixture extends CakeTestFixture { | |
public $fields = array( | |
'id' => array('type' => 'integer', 'key' => 'primary'), | |
'name' => array('type' => 'string', 'null' => false), | |
'surname' => array('type' => 'string', 'null' => false), | |
); | |
public $records = array( | |
array('id' => 1, 'name' => 'Walter', 'surname' => 'Raponi' ), |
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
CREATE TABLE `phonetags` ( | |
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, | |
`phonetag` VARCHAR(200) COLLATE utf8_unicode_ci NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | |
CREATE TABLE `mailtags` ( | |
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, | |
`mailtag` VARCHAR(200) COLLATE utf8_unicode_ci NOT NULL, | |
PRIMARY KEY (`id`) |
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
<?php | |
class DATABASE_CONFIG { | |
public $default = array( | |
'datasource' => 'Database/Mysql', | |
'persistent' => false, | |
'host' => 'localhost', | |
'login' => 'cakephp', | |
'password' => 'cakephp', | |
'database' => 'cakephp_test', |
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
<?php | |
class AppController extends Controller { | |
public $components = array('DebugKit.Toolbar'); | |
} |
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
<?php | |
CakePlugin::load('DebugKit'); |
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
git clone --single-branch --branch 2.2 git://github.com/cakephp/debug_kit.git DebugKit |
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
git submodule add --branch 2.2 git://github.com/cakephp/debug_kit.git Plugin/DebugKit | |
git submodule init | |
git submodule update |