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


PHP Notification::getAlertId方法代码示例

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


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

示例1: testGetValidProductByAlertId

 /**
  * test grabbing valid product by alertId
  **/
 public function testGetValidProductByAlertId()
 {
     // create a new notification and insert to into mySQL
     $newNotification = new Notification(null, $this->alertLevel->getAlertId(), $this->VALID_emailStatus, $this->VALID_notificationDateTime, $this->VALID_notificationHandle, $this->VALID_notificationContent);
     $newNotification->insert($this->getPDO());
     // grab the data from guzzle
     $response = $this->guzzle->get('https://bootcamp-coders.cnm.edu/~invtext/backend/php/api/notification/?alertId=' . $newNotification->getAlertId());
     $this->assertSame($response->getStatusCode(), 200);
     $body = $response->getBody();
     $notification = json_decode($body);
     $this->assertSame(200, $notification->status);
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:15,代码来源:notification-api-test.php

示例2: testGetValidNotificationsByAlertId

 /**
  * test grabbing an product by alert Id
  **/
 public function testGetValidNotificationsByAlertId()
 {
     // create a new notification and insert to into mySQL
     $notification = new Notification(null, $this->alertLevel->getAlertId(), $this->VALID_emailStatus, $this->VALID_notificationDateTime, $this->VALID_notificationHandle, $this->VALID_notificationContent);
     $notification->insert($this->getPDO());
     // grab the data from mySQL and enforce the fields match our expectations
     $pdoProductArray = Notification::getProductByAlertId($this->getPDO(), $notification->getAlertId());
     for ($i = 0; $i < count($pdoProductArray); $i++) {
         if ($i === 0) {
             $this->assertSame($pdoProductArray[$i]->getAlertId(), $this->alertLevel->getAlertId());
             $this->assertSame($pdoProductArray[$i]->getEmailStatus(), $this->VALID_emailStatus);
             $this->assertEquals($pdoProductArray[$i]->getNotificationDateTime(), $this->VALID_notificationDateTime);
             $this->assertSame($pdoProductArray[$i]->getNotificationHandle(), $this->VALID_notificationHandle);
             $this->assertSame($pdoProductArray[$i]->getNotificationContent(), $this->VALID_notificationContent);
         } else {
             $this->assertSame($pdoProductArray[$i]->getProductId(), $this->product->getProductId());
             $this->assertSame($pdoProductArray[$i]->getVendorId(), $this->product->getVendorId());
             $this->assertSame($pdoProductArray[$i]->getDescription(), $this->product->getDescription());
             $this->assertSame($pdoProductArray[$i]->getSku(), $this->product->getSku());
             $this->assertSame($pdoProductArray[$i]->getTitle(), $this->product->getTitle());
         }
     }
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:26,代码来源:notification-test.php

示例3: testGetValidNotificationByProductId

 /**
  * test grabbing product by notification
  **/
 public function testGetValidNotificationByProductId()
 {
     // create a new product and insert to into mySQL
     $product = new Product(null, $this->vendor->getVendorId(), $this->VALID_description, $this->VALID_leadTime, $this->VALID_sku, $this->VALID_title);
     $product->insert($this->getPDO());
     // create a new product and insert to into mySQL
     $productAlert = new ProductAlert($this->alertLevel->getAlertId(), $product->getProductId(), true);
     $productAlert->insert($this->getPDO());
     // grab the data from mySQL and enforce the fields match our expectations
     $pdoNotificationArray = Product::getNotificationByProductId($this->getPDO(), $product->getProductId());
     for ($i = 0; $i < count($pdoNotificationArray); $i++) {
         if ($i === 0) {
             $this->assertSame($pdoNotificationArray[$i]->getVendorId(), $this->vendor->getVendorId());
             $this->assertSame($pdoNotificationArray[$i]->getDescription(), $this->VALID_description);
             $this->assertSame($pdoNotificationArray[$i]->getLeadTime(), $this->VALID_leadTime);
             $this->assertSame($pdoNotificationArray[$i]->getSku(), $this->VALID_sku);
             $this->assertSame($pdoNotificationArray[$i]->getTitle(), $this->VALID_title);
         } else {
             $this->assertSame($pdoNotificationArray[$i]->getNotificationId(), $this->notification->getNotificationId());
             $this->assertSame($pdoNotificationArray[$i]->getAlertId(), $this->notification->getAlertId());
             $this->assertSame($pdoNotificationArray[$i]->getEmailStatus(), $this->notification->getEmailStatus());
             $this->assertEquals($pdoNotificationArray[$i]->getNotificationDateTime(), $this->notification->getNotificationDateTime());
             $this->assertSame($pdoNotificationArray[$i]->getNotificationHandle(), $this->notification->getNotificationHandle());
             $this->assertSame($pdoNotificationArray[$i]->getNotificationContent(), $this->notification->getNotificationContent());
         }
     }
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:30,代码来源:product-test.php


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