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

Revision 22190, 1.8 KB checked in by poego, 11 years ago (diff)

#1993 SC_Productテストケース作成

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_findProductsOrderTest 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('2001','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','2001');
43
44        $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery);
45
46        $this->verify('商品ID昇順');
47    }
48   
49    public function testFindProductIdsOrder_arrOrderData設定時() {
50        $this->setUpProductClass();
51        $this->setUpProducts();
52        $this->setUpClassCategory();
53
54        // setProductsOrderを行う
55        $this->objProducts->setProductsOrder('product_id');
56        $this->expected = array('1001', '1002','2001');
57
58        $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery);
59
60        $this->verify('arrOrderData設定時');
61    }
62   
63}
Note: See TracBrowser for help on using the repository browser.