本文整理汇总了PHP中Brand::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Brand::update方法的具体用法?PHP Brand::update怎么用?PHP Brand::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Brand
的用法示例。
在下文中一共展示了Brand::update方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUpdate
function testUpdate()
{
$brand_name = "dr.martens";
$new_brand = new Brand($brand_name);
$new_brand->save();
$new_brand->setBrandName("doc martens");
$new_brand->update();
$result = Brand::getAll();
$this->assertEquals($new_brand, $result[0]);
}
示例2: Brand
function test_update()
{
$test_name = "Helmut Lang";
$test_id = 1;
$test_brand = new Brand($test_name, $test_id);
$test_brand->save();
$new_name = "Y-3";
$test_brand->update($new_name);
$result = Brand::getAll();
$this->assertEquals($new_name, $result[0]->getName());
}
示例3: testUpdate
function testUpdate()
{
// Arrange
$brand_name = "Babbling Brooks";
$test_Brand = new Brand($brand_name);
$test_Brand->save();
$new_name = "Gibberish Producing Brooks";
// Act
$test_Brand->update($new_name);
$result = $test_Brand->getName();
// Assert
$this->assertEquals($new_name, $result);
}
示例4: Brand
function test_update()
{
//Arrange
$name = "Nike";
$id = null;
$test_brand = new Brand($name, $id);
$test_brand->save();
$new_name = "Adidas";
//Act
$test_brand->update($new_name);
//Assert
$this->assertEquals($new_name, $test_brand->getName());
}
示例5: testUpdate
function testUpdate()
{
//Arrange
$brand_name = "Sketchers";
$test_brand = new Brand($brand_name);
$test_brand->save();
$new_name = "Vans";
//Act
$test_brand->update($new_name);
//Assert
$this->assertEquals($new_name, $test_brand->getBrandName());
}
示例6: testUpdate
function testUpdate()
{
//Arrange
$brand_name = "Nike";
$id = 1;
$test_brand = new Brand($brand_name, $id);
$test_brand->save();
$new_brand_name = "Fila";
//Act
$test_brand->update($new_brand_name);
//Assert
$this->assertEquals('Fila', $test_brand->getBrandName());
}
示例7: function
echo "<script>window.location='../../'</script>";
}
});
// $app->post('/brands', function() use($brand, $app) {
// $request = $app->request();
// $body = $request->getBody();
// $data = json_decode($body);
// $brand->insert($data);
// });
$app->put('/brands/:id', function ($id) use($brand, $app) {
if (isset($_SESSION['app']) && isset($_COOKIE['app'])) {
$request = $app->request();
$body = $request->getBody();
$data = json_decode($body);
$data->id = $id;
$brand->update($data);
} else {
echo "<script>window.location='../../'</script>";
}
});
$app->get('/users/:id', function ($id) use($user) {
if (isset($_SESSION['app']) && isset($_COOKIE['app'])) {
$user->getUser($id);
} else {
echo "<script>window.location='../../'</script>";
}
});
$app->put('/users/:id', function ($id) use($user, $app) {
if (isset($_SESSION['app']) && isset($_COOKIE['app'])) {
$request = $app->request();
$body = $request->getBody();