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

Revision 22567, 1.8 KB checked in by shutta, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.12.4)
Zend Framework PHP 標準コーディング規約のコーディングスタイルへ準拠。
classおよびfunctionの開始波括弧「{」のスタイルを修正。

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
11    protected function setUp()
12    {
13        parent::setUp();
14        $this->objProducts = new SC_Product_Ex();
15    }
16
17    protected function tearDown()
18    {
19        parent::tearDown();
20    }
21
22    /////////////////////////////////////////
23
24    public function testFindProductIdsOrder_商品ID降順()
25    {
26        $this->setUpProductClass();
27        $this->setUpProducts();
28        $this->setUpClassCategory();
29
30        // 商品ID降順で商品IDを取得する
31        $this->objQuery->setOrder('product_id DESC');
32        $this->expected = array('2001','1002', '1001');
33
34        $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery);
35
36        $this->verify('商品ID降順');
37    }
38
39    public function testFindProductIdsOrder_商品名昇順()
40    {
41        $this->setUpProductClass();
42        $this->setUpProducts();
43        $this->setUpClassCategory();
44
45        // 商品名昇順で商品IDを取得する
46        $this->objQuery->setOrder('product_id ASC');
47        $this->expected = array('1001', '1002','2001');
48
49        $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery);
50
51        $this->verify('商品ID昇順');
52    }
53   
54    public function testFindProductIdsOrder_arrOrderDataの設定による並び順()
55    {
56        $this->setUpProductClass();
57        $this->setUpProducts();
58        $this->setUpClassCategory();
59
60        // setProductsOrderを行う
61        $this->objProducts->setProductsOrder('product_id');
62        $this->expected = array('1001', '1002','2001');
63
64        $this->actual = $this->objProducts->findProductIdsOrder($this->objQuery);
65
66        $this->verify('arrOrderData設定順');
67    }
68   
69}
Note: See TracBrowser for help on using the repository browser.