/** * @depends testGetAvailableAttributesForSummationOrderBysThatAreDisplayCalculations */ public function testGetAvailableAttributesForSummationGroupBys() { $model = new ReportModelTestItem(); $rules = new ReportsTestReportRules(); $report = new Report(); $report->setType(Report::TYPE_SUMMATION); $report->setModuleClassName('ReportsTestModule'); $adapter = new ModelRelationsAndAttributesToSummationReportAdapter($model, $rules, $report->getType()); $attributes = $adapter->getAttributesForGroupBys(); $this->assertEquals(38, count($attributes)); //Date/DateTime columns first... $compareData = array('label' => 'Date -(Year)'); $this->assertEquals($compareData, $attributes['date__Year']); $compareData = array('label' => 'Date -(Quarter)'); $this->assertEquals($compareData, $attributes['date__Quarter']); $compareData = array('label' => 'Date -(Month)'); $this->assertEquals($compareData, $attributes['date__Month']); $compareData = array('label' => 'Date -(Week)'); $this->assertEquals($compareData, $attributes['date__Week']); $compareData = array('label' => 'Date -(Day)'); $this->assertEquals($compareData, $attributes['date__Day']); $compareData = array('label' => 'Date Time -(Year)'); $this->assertEquals($compareData, $attributes['dateTime__Year']); $compareData = array('label' => 'Date Time -(Quarter)'); $this->assertEquals($compareData, $attributes['dateTime__Quarter']); $compareData = array('label' => 'Date Time -(Month)'); $this->assertEquals($compareData, $attributes['dateTime__Month']); $compareData = array('label' => 'Date Time -(Week)'); $this->assertEquals($compareData, $attributes['dateTime__Week']); $compareData = array('label' => 'Date Time -(Day)'); $this->assertEquals($compareData, $attributes['dateTime__Day']); $compareData = array('label' => 'Created Date Time -(Year)'); $this->assertEquals($compareData, $attributes['createdDateTime__Year']); $compareData = array('label' => 'Created Date Time -(Quarter)'); $this->assertEquals($compareData, $attributes['createdDateTime__Quarter']); $compareData = array('label' => 'Created Date Time -(Month)'); $this->assertEquals($compareData, $attributes['createdDateTime__Month']); $compareData = array('label' => 'Created Date Time -(Week)'); $this->assertEquals($compareData, $attributes['createdDateTime__Week']); $compareData = array('label' => 'Created Date Time -(Day)'); $this->assertEquals($compareData, $attributes['createdDateTime__Day']); $compareData = array('label' => 'Modified Date Time -(Year)'); $this->assertEquals($compareData, $attributes['modifiedDateTime__Year']); $compareData = array('label' => 'Modified Date Time -(Quarter)'); $this->assertEquals($compareData, $attributes['modifiedDateTime__Quarter']); $compareData = array('label' => 'Modified Date Time -(Month)'); $this->assertEquals($compareData, $attributes['modifiedDateTime__Month']); $compareData = array('label' => 'Modified Date Time -(Week)'); $this->assertEquals($compareData, $attributes['modifiedDateTime__Week']); $compareData = array('label' => 'Modified Date Time -(Day)'); $this->assertEquals($compareData, $attributes['modifiedDateTime__Day']); //and then the rest of the attributes... (exclude text area) $compareData = array('label' => 'First Name'); $this->assertEquals($compareData, $attributes['firstName']); $compareData = array('label' => 'Last Name'); $this->assertEquals($compareData, $attributes['lastName']); $compareData = array('label' => 'Boolean'); $this->assertEquals($compareData, $attributes['boolean']); $compareData = array('label' => 'Float'); $this->assertEquals($compareData, $attributes['float']); $compareData = array('label' => 'Integer'); $this->assertEquals($compareData, $attributes['integer']); $compareData = array('label' => 'Phone'); $this->assertEquals($compareData, $attributes['phone']); $compareData = array('label' => 'String'); $this->assertEquals($compareData, $attributes['string']); $compareData = array('label' => 'Url'); $this->assertEquals($compareData, $attributes['url']); $compareData = array('label' => 'Drop Down'); $this->assertEquals($compareData, $attributes['dropDown']); $compareData = array('label' => 'Drop Down 2'); $this->assertEquals($compareData, $attributes['dropDown2']); $compareData = array('label' => 'Radio Drop Down'); $this->assertEquals($compareData, $attributes['radioDropDown']); $compareData = array('label' => 'Reported As Attribute'); $this->assertEquals($compareData, $attributes['reportedAsAttribute']); $compareData = array('label' => 'Currency Value'); $this->assertEquals($compareData, $attributes['currencyValue']); $compareData = array('label' => 'A name for a state'); $this->assertEquals($compareData, $attributes['likeContactState']); //Add Id field $compareData = array('label' => 'Id'); $this->assertEquals($compareData, $attributes['id']); //Add Dynamically Derived Attributes $compareData = array('label' => 'Owner'); $this->assertEquals($compareData, $attributes['owner__User']); $compareData = array('label' => 'Created By User'); $this->assertEquals($compareData, $attributes['createdByUser__User']); $compareData = array('label' => 'Modified By User'); $this->assertEquals($compareData, $attributes['modifiedByUser__User']); }