示例#1
0
 /**
  * @return void
  */
 public function testGetAllTypesValues()
 {
     $priceType = SpyPriceTypeQuery::create()->filterByName(self::DUMMY_PRICE_TYPE_2)->findOneOrCreate();
     $priceType->setName(self::DUMMY_PRICE_TYPE_2)->save();
     $priceType = SpyPriceTypeQuery::create()->filterByName(self::DUMMY_PRICE_TYPE_1)->findOneOrCreate();
     $priceType->setName(self::DUMMY_PRICE_TYPE_1)->save();
     $priceTypes = $this->priceFacade->getPriceTypeValues();
     $isTypeInResult_1 = false;
     $isTypeInResult_2 = false;
     foreach ($priceTypes as $priceType) {
         if ($priceType === self::DUMMY_PRICE_TYPE_1) {
             $isTypeInResult_1 = true;
         } elseif ($priceType === self::DUMMY_PRICE_TYPE_2) {
             $isTypeInResult_2 = true;
         }
     }
     $this->assertTrue($isTypeInResult_1);
     $this->assertTrue($isTypeInResult_2);
 }