source: branches/version-2_12-dev/tests/class/SC_Product/SC_Product_findProductIdsOrderTest.php @ 22188

Revision 22188, 1.3 KB checked in by nanasess, 11 years ago (diff)

#1993 ([共通クラス]SC_Products)

基底クラスと, 以下を追加

  • SC_Product::findProductIdsOrder
  • SC_Product_setProductsOrder
Line 
1<?php
2
3$HOME = realpath(dirname(__FILE__)) . "/../../..";
4require_once($HOME . "/tests/class/SC_Product/SC_Product_TestBase.php");
5/**
6 *
7 */
8class SC_Product_setProductsOrderTest extends SC_Product_TestBase {
9
10    protected function setUp() {
11        parent::setUp();
12        $this->objProducts = new SC_Product_Ex();
13    }
14
15    protected function tearDown() {
16        parent::tearDown();
17    }
18
19    /////////////////////////////////////////
20
21    public function testFindProductIdsOrder_商品ID降順() {
22        $this->setUpProductClass();
23        $this->setUpProducts();
24        $this->setUpClassCategory();
25
26        // 商品ID降順で商品IDを取得する
27        $this->objQuery->setOrder('product_id DESC');
28        $this->expected = array('1002', '1001');
29
30        $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery);
31
32        $this->verify('商品ID降順');
33    }
34
35    public function testFindProductIdsOrder_商品名昇順() {
36        $this->setUpProductClass();
37        $this->setUpProducts();
38        $this->setUpClassCategory();
39
40        // 商品名昇順で商品IDを取得する
41        $this->objQuery->setOrder('product_id ASC');
42        $this->expected = array('1001', '1002');
43
44        $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery);
45
46        $this->verify('商品ID昇順');
47    }
48}
Note: See TracBrowser for help on using the repository browser.