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


PHP Brand::update方法代码示例

本文整理汇总了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]);
 }
开发者ID:jschold,项目名称:shoe_stores,代码行数:10,代码来源:BrandTest.php

示例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());
 }
开发者ID:juliocesardiaz,项目名称:Shoes,代码行数:11,代码来源:BrandTest.php

示例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);
 }
开发者ID:ben-pritchard,项目名称:Epicodus-Assessment---PHP-Many-to-Many-in-Silex,代码行数:13,代码来源:brandTest.php

示例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());
 }
开发者ID:jcubed22,项目名称:Shoes,代码行数:13,代码来源:BrandTest.php

示例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());
 }
开发者ID:kellimargaret,项目名称:Shoe_Stores,代码行数:12,代码来源:BrandTest.php

示例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());
 }
开发者ID:jtorrespdx,项目名称:Shoe_stores,代码行数:13,代码来源:BrandTest.php

示例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();
开发者ID:jhonrsalcedo,项目名称:BSG,代码行数:31,代码来源:index.php


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