public function test2Members() { $test = new Query("[Sales]"); $test->addElement("[Measures].[Store Sales]", "ROW"); $test->addElement("[Time].[Month].Members", "COL"); $test->addCalculatedMember('[Measures].[moyenne]', '[Measures].[Store Sales] / [Measures].[Sales Count]', 'ROW'); $test->addCalculatedMember('[Measures].[tendance]', 'IIF(([Measures].[Store Sales], Time.PrevMember)<=([Measures].[Store Sales], Time.CurrentMember), "Croissance", "Décroissance")', 'ROW'); $result = 'WITH MEMBER [Measures].[moyenne] AS [Measures].[Store Sales]' . ' / [Measures].[Sales Count] MEMBER [Measures].[tendance] AS' . ' IIF(([Measures].[Store Sales], Time.PrevMember)<=([Measures].[Store Sales],' . ' Time.CurrentMember), "Croissance", "Décroissance")' . ' SELECT [Time].[Month].Members ON COLUMNS,' . " {[Measures].[Store Sales], [Measures].[moyenne], [Measures].[tendance]} ON ROWS" . " FROM [Sales]"; $this->assertEquals($test->toMdx(), $result); }
public function testNonEmpty() { $test = new Query("[Sales]"); $this->assertEquals($test->getNonEmpty(), false); $test->setNonEmpty(true); $this->assertEquals($test->getNonEmpty(), true); }
public function testDrillThrough() { $test = new Query("[Sales]"); $test->addElement("[Measures].[Unit Sales]", "COL"); $test->addElement("[Promotion Media].[All Media]", "ROW"); $test->setDrillThrough(true); $result = 'DRILLTHROUGH SELECT {[Measures].[Unit Sales]} ON COLUMNS, [Promotion Media].[All Media] ON ROWS FROM [Sales]'; $this->assertEquals($test->toMdx(), $result); $this->assertEquals($test->isDrillThrough(), true); $test->setDrillThrough(true, 30, 60); $result = 'DRILLTHROUGH MAXROWS 30 FRISTROWSET 60SELECT {[Measures].[Unit Sales]} ON COLUMNS, [Promotion Media].[All Media] ON ROWS FROM [Sales]'; $this->assertEquals($test->toMdx(), $result); $test->setDrillThrough(false); $this->assertEquals($test->isDrillThrough(), false); }