当前位置: 首页>>代码示例>>PHP>>正文


PHP Review::update方法代码示例

本文整理汇总了PHP中Review::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Review::update方法的具体用法?PHP Review::update怎么用?PHP Review::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Review的用法示例。


在下文中一共展示了Review::update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Review

 function test_update()
 {
     //Arrange
     $beer_id = 1;
     $user_id = 1;
     $review = "Great beer";
     $date = "2015-10-08";
     $id = 3;
     $test_review = new Review($beer_id, $user_id, $review, $date, $id);
     $test_review->save();
     $new_review = "Bad beer";
     $new_review_date = "2015-10-09";
     //Act
     $test_review->update($new_review, $new_review_date);
     $updated_review = $test_review->getReview();
     $updated_review_date = $test_review->getReviewDate();
     $result = [$updated_review, $updated_review_date];
     //Assert
     $this->assertEquals([$new_review, $new_review_date], $result);
 }
开发者ID:bborealis,项目名称:growler,代码行数:20,代码来源:ReviewTest.php

示例2: update

 public function update()
 {
     return Review::update($this->params);
 }
开发者ID:ncowan15,项目名称:FoodApp3,代码行数:4,代码来源:reviews.php

示例3: connectToEncryptedMySQL

<?php

require_once "/etc/apache2/capstone-mysql/encrypted-config.php";
require_once "review.php";
$pdo = connectToEncryptedMySQL("/etc/apache2/data-design/jfindley2.ini");
$review = new Review(null, 1, 2, "It was ok", 1, null);
$review->insert($pdo);
$review->setReviewText("It was decent");
$review->update($pdo);
$review->delete($pdo);
开发者ID:jfindley2,项目名称:amazon-product,代码行数:10,代码来源:review-shakedown.php

示例4: Cuisine

 function test_update()
 {
     $name = "Asian";
     $id = null;
     $test_cuisine = new Cuisine($name, $id);
     $test_cuisine->save();
     $restaurant_name = "The Golden Duck";
     $location = "898 SW 5th Ave, Portland, OR";
     $description = "A Chill Asian experince";
     $price = "\$\$";
     $cuisine_id = $test_cuisine->getId();
     $test_restaurant = new Restaurant($restaurant_name, $location, $description, $price, $cuisine_id);
     $test_restaurant->save();
     $user = "yoloswag1959";
     $stars = 3;
     $headline = "It is aight.";
     $body = "Yeah, pretty aight bro";
     $restaurant_id = $test_restaurant->getId();
     $test_review = new Review($user, $stars, $headline, $body, $restaurant_id);
     $test_review->save();
     $user2 = "6969babygirl";
     $stars2 = 3;
     $headline2 = "XOXO";
     $body2 = "I cant even";
     $restaurant_id2 = $test_restaurant->getId();
     $test_review->update($user2, $stars2, $headline2, $body2, $restaurant_id2);
     $result = $test_review->getUser();
     $this->assertEquals("6969babygirl", $result);
 }
开发者ID:juliocesardiaz,项目名称:Best-restaurants,代码行数:29,代码来源:ReviewTest.php


注:本文中的Review::update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。