Example #1
0
 /**
  * 検索用データを生成する
  *
  * @param int $name ページID
  * @param string $name ページ名
  * @param id $categoryId ページカテゴリーID
  * @param string $title ページタイトル
  * @param string $url ページURL
  * @param string $description ページ概要
  * @param date $publish_begin 公開開始日時
  * @param date $publish_end 公開終了日時
  * @param date $detail 期待するページdescription
  * @param int $status 公開状態
  * @param string $message テストが失敗した時に表示されるメッセージ
  * @dataProvider createContentDataProvider
  */
 public function testCreateSearchIndex($id, $name, $categoryId, $title, $url, $description, $publish_begin, $publish_end, $status, $message = null)
 {
     $this->markTestIncomplete('このテストは、まだ実装されていません。');
     $data = array('Page' => array('id' => $id, 'name' => $name, 'page_category_id' => $categoryId, 'title' => $title, 'url' => $url, 'description' => $description, 'publish_begin' => $publish_begin, 'publish_end' => $publish_end, 'status' => $status));
     $expected = array('Content' => array('model_id' => $id, 'type' => 'ページ', 'category' => '', 'title' => $title, 'detail' => '', 'url' => $url, 'status' => $status));
     $result = $this->Page->createContent($data);
     $this->assertEquals($expected, $result, $message);
 }
Example #2
0
$car1 = new Car('Chevrolet', 'Malibu', 'Tan', '2016', 'v4', '4');
$car2 = new Car('Toyota', 'Camry', 'Black', '2015', 'v4', '4');
$car3 = new Car('Honda', 'Civic', 'White', '2014', 'v4', '2');
$car4 = new Car('Jeep', 'Grand Cherokee', 'Red', '2016', 'v8', '4');
$car5 = new Car('Dodge', 'Ram', 'Yellow', '2015', 'v8', '4');
$cars = array($car1, $car2, $car3, $car4, $car5);
$inputFields = array('0' => array('desc' => 'First name:', 'type' => 'text', 'name' => 'fname', 'value' => 'First Name'), '1' => array('desc' => 'Middle name:', 'type' => 'text', 'name' => 'mname', 'value' => 'Middle Name'), '2' => array('desc' => 'Password', 'type' => 'password', 'name' => 'pass', 'value' => 'Password'), '3' => array('desc' => 'Male', 'type' => 'radio', 'name' => 'gender', 'value' => 'male', 'checked' => 'checked'), '4' => array('desc' => 'Female', 'type' => 'radio', 'name' => 'gender', 'value' => 'female'), '5' => array('desc' => 'Other', 'type' => 'radio', 'name' => 'gender', 'value' => 'other'), '6' => array('desc' => 'I have a bike', 'type' => 'checkbox', 'name' => 'vehicle1', 'value' => 'Bike'), '7' => array('desc' => 'I have a car', 'type' => 'checkbox', 'name' => 'vehicle2', 'value' => 'Car'));
$john = new Person('Waiter', 'John', 'Smith', '*****@*****.**');
$mary = new Person('Realtor', 'Mary', 'Smith', '*****@*****.**');
$tony = new Person('Teacher', 'Tony', 'Hawk', '*****@*****.**');
$johnny = new Person('Unemployed', 'Johnny', 'Appleseed', '*****@*****.**');
$people = array($john, $mary, $tony, $johnny);
// Testing
$obj = new Page("Homepage");
$obj->createHeader();
$obj->createContent("Header");
echo '<hr>';
$obj->createParagraph("This is a sample paragraph.");
echo '<hr>';
$obj->createLink("http://www.w3schools.com", "W3Schools");
//$obj->createTable("Table", "Content");
echo '<hr>';
$obj->createHeading('h1', 'This is a heading - h1');
$obj->createHeading('h2', 'This is a heading - h2');
$obj->createHeading('h3', 'This is a heading - h3');
echo '<hr>';
$obj->createForm($inputFields, 'index2.php');
echo '<hr>';
// Create table
echo '<h3>createTable($people) function</h3>';
createTable($people);