Best Atoum code snippet using report
AbstractReportTest.php
Source:AbstractReportTest.php
...8class AbstractReportTest extends \PHPUnit\Framework\TestCase9{10 const TEST_TOKEN = 'token_string';11 const TEST_ADVERTIZER_ID = '123456';12 protected $report,13 $curl;14 protected function setUp()15 {16 $this->report = $this->getMockedReport(['getEndpoint']);17 }18 protected function tearDown()19 {20 $this->report = null;21 $this->mockedCurl = null;22 }23 public function testGetApplication()24 {25 $apps = ['app1'];26 $this->mockedCurl27 ->expects($this->any())28 ->method('postRequest')29 ->with(30 $this->stringEndsWith(AbstractReport::ENDPOINT_APPLICATIONS),31 $this->arrayHasKey(AbstractReportValues::FIELD_API_KEY)32 )33 ->will($this->returnValue($apps));34 $endpoint = AbstractReport::BASE_URL 35 . '/' . AbstractReport::DEFAULT_API_VERSION 36 . '/' . AbstractReport::ENDPOINT_APPLICATIONS;37 $this->report->expects($this->any())38 ->method('getEndpoint')39 ->with($this->stringEndsWith(AbstractReport::ENDPOINT_APPLICATIONS))40 ->will($this->returnValue($endpoint));41 $this->assertContains($apps[0], $this->report->getApplications());42 }43 public function testGetColumns()44 {45 $columns = ['col1'];46 $this->mockedCurl47 ->expects($this->any())48 ->method('postRequest')49 ->with(50 $this->stringEndsWith(AbstractReport::ENDPOINT_REPORTCOLUMNS),51 $this->logicalAnd(52 $this->arrayHasKey(AbstractReportValues::FIELD_API_KEY),53 $this->arrayHasKey(AbstractReportValues::FIELD_APP_GUID)54 )55 )56 ->will($this->returnValue($columns));57 $endpoint = AbstractReport::BASE_URL 58 . '/' . AbstractReport::DEFAULT_API_VERSION 59 . '/' . AbstractReport::ENDPOINT_REPORTCOLUMNS;60 $this->report->expects($this->once())61 ->method('getEndpoint')62 ->with($this->stringEndsWith(AbstractReport::ENDPOINT_REPORTCOLUMNS))63 ->will($this->returnValue($endpoint));64 $this->assertContains($columns[0], $this->report->getColumns());65 }66 public function testGetEndpoint()67 {68 $this->report = $this->getMockedReport();69 $method = $this->getMethod('getEndpoint');70 $this->assertStringEndsWith(71 AbstractReport::ENDPOINT_REPORT_STATUS,72 $method->invoke($this->report, AbstractReport::ENDPOINT_REPORT_STATUS)73 );74 }75 public function testGetReport()76 {77 $this->report = $this->getMockedReport([78 'obtainReportStatus', 79 'fetchReport',80 ]);81 $params = [82 ReportSummaryValues::FIELD_TRAFFIC => ['event'],83 ReportSummaryValues::FIELD_TIME_SIRIES => '1',84 ];85 $returnFromAddReportToQueque = [86 'status' => 'queued',87 ];88 $returnFromObtainReportStatus = [89 'status' => 'completed',90 'report' => 'link',91 ];92 $report = [93 'fetchedReport1',94 'fetchedReport2',95 ];96 $this->report->expects($this->once())97 ->method('addReportToQueue')98 ->with($params)99 ->will($this->returnValue($returnFromAddReportToQueque));100 $this->report->expects($this->once())101 ->method('obtainReportStatus')102 ->with($returnFromAddReportToQueque)103 ->will($this->returnValue($returnFromObtainReportStatus));104 $this->report->expects($this->once())105 ->method('fetchReport')106 ->with($returnFromObtainReportStatus['report'])107 ->will($this->returnValue($report));108 $this->assertContains(109 $report[0],110 $this->report->getReport($params)111 );112 }113 public function testGetReportFail()114 {115 $this->report = $this->getMockedReport([116 'obtainReportStatus', 117 'fetchReport',118 ]);119 $params = [120 ReportSummaryValues::FIELD_TRAFFIC => ['event'],121 ReportSummaryValues::FIELD_TIME_SIRIES => '1',122 ];123 $returnFromAddReportToQueque = [124 'status' => 'Error',125 ];126 $returnFromObtainReportStatus = [127 'status' => 'completed',128 'report' => 'link',129 ];130 $report = [131 'fetchedReport1',132 'fetchedReport2',133 ];134 $this->report->expects($this->once())135 ->method('addReportToQueue')136 ->with($params)137 ->will($this->returnValue($returnFromAddReportToQueque));138 $this->expectException(\KochavaReporting\ReportException::class);139 $this->report->getReport($params);140 }141 public function testGetReportFail2()142 {143 $this->report = $this->getMockedReport([144 'obtainReportStatus', 145 'fetchReport',146 ]);147 $params = [148 ReportSummaryValues::FIELD_TRAFFIC => ['event'],149 ReportSummaryValues::FIELD_TIME_SIRIES => '1',150 ];151 $returnFromAddReportToQueque = [152 'status' => 'queued',153 ];154 $returnFromObtainReportStatus = [155 'status' => 'error',156 ];157 $report = [158 'fetchedReport1',159 'fetchedReport2',160 ];161 $this->report->expects($this->once())162 ->method('addReportToQueue')163 ->with($params)164 ->will($this->returnValue($returnFromAddReportToQueque));165 $this->report->expects($this->once())166 ->method('obtainReportStatus')167 ->with($returnFromAddReportToQueque)168 ->will($this->returnValue($returnFromObtainReportStatus));169 $this->expectException(\KochavaReporting\ReportException::class);170 $this->report->getReport($params);171 }172 public function testObtainReportStatus()173 {174 $this->report = $this->getMockedReport(['getEndpoint']);175 $method = $this->getMethod('obtainReportStatus');176 $endpoint = AbstractReport::BASE_URL 177 . '/' . AbstractReport::DEFAULT_API_VERSION 178 . '/' . AbstractReport::ENDPOINT_REPORT_STATUS;179 $this->report->expects($this->exactly(2))180 ->method('getEndpoint')181 ->with($this->equalTo(AbstractReport::ENDPOINT_REPORT_STATUS))182 ->will($this->returnValue($endpoint));183 $returnPostRequest = ['status' => 'completed'];184 $this->mockedCurl->expects($this->at(0))185 ->method('postRequest')186 ->with(187 $this->equalTo($endpoint),188 $this->logicalAnd(189 $this->arrayHasKey(ReportSummaryValues::FIELD_API_KEY),190 $this->arrayHasKey(ReportSummaryValues::FIELD_APP_GUID),191 $this->arrayHasKey(ReportSummaryValues::FIELD_TOKEN)192 ))193 ->will($this->returnValue($returnPostRequest));194 $job = ['report_token' => 'test_temporary_token'];195 $this->assertContains(196 $returnPostRequest['status'],197 $method->invoke($this->report, $job)198 );199 $returnPostRequest = ['status' => 'error'];200 $this->mockedCurl->expects($this->at(1))201 ->method('postRequest')202 ->with(203 $this->equalTo($endpoint),204 $this->logicalAnd(205 $this->arrayHasKey(ReportSummaryValues::FIELD_API_KEY),206 $this->arrayHasKey(ReportSummaryValues::FIELD_APP_GUID),207 $this->arrayHasKey(ReportSummaryValues::FIELD_TOKEN)208 ))209 ->will($this->returnValue($returnPostRequest));210 $this->expectException(\KochavaReporting\ReportException::class);211 $method->invoke($this->report, $job);212 }213 public function testFetchReport()214 {215 $this->report = $this->getMockedReport(['readReportAsJSON']);216 $pathToReport = 'pathToReport';217 $method = $this->getMethod('fetchReport');218 $returnFromReadReportAsJson = 'json string';219 $this->report->expects($this->once())220 ->method('readReportAsJSON')221 ->with($this->equalTo($pathToReport))222 ->will($this->returnValue($returnFromReadReportAsJson));223 $this->assertEquals(224 $returnFromReadReportAsJson,225 $method->invoke($this->report, $pathToReport)226 );227 }228 public function testReadReportAsJSON()229 {230 if (!is_writable(__DIR__)) {231 throw new Exception('a test directory have to be writeable to perform a test "' . __METHOD__ . '"' . PHP_EOL);232 }233 $report = ['foo' => 'bar'];234 $tmpDir = __DIR__ . DIRECTORY_SEPARATOR . 'tmp';235 mkdir($tmpDir, 0777);236 $pathToReport = $tmpDir . DIRECTORY_SEPARATOR . 'jsonReport.json';237 file_put_contents($pathToReport, json_encode($report));238 $method = $this->getMethod('readReportAsJSON');239 $this->assertArrayHasKey(240 'foo',241 $method->invoke($this->report, $pathToReport)242 );243 unlink($pathToReport);244 }245 public function testGetErrorMsg()246 {247 $method = $this->getMethod('getErrorMsg');248 $params = [249 'error' => 'An error occurred',250 ];251 $this->assertEquals(252 $params['error'],253 $method->invoke($this->report, $params)254 );255 $params = [];256 $this->assertEquals(257 AbstractReport::ERROR_MSG,258 $method->invoke($this->report, $params)259 );260 }261 public function testGetDeliveryFormat()262 {263 $this->assertEquals(264 AbstractReport::DELIVERY_FORMAT_JSON,265 $this->report->getDeliveryFormat()266 );267 }268 protected function getMockedReport(array $methodsToMocking = [])269 {270 return $this->getMockForAbstractClass(271 AbstractReport::class,272 [273 $this->getMockedCurlAdapter(),274 static::TEST_TOKEN,275 static::TEST_ADVERTIZER_ID276 ],277 '',278 true,279 true,280 true,281 $methodsToMocking282 );283 }284 protected function getMockedCurlAdapter()285 {286 if (empty($this->mockedCurl)) {287 $this->mockedCurl = $this->getMockBuilder(CurlAdapter::class)288 ->setMethods(['postRequest'])289 ->getMock();290 }291 return $this->mockedCurl;292 }293 protected function getMethod($name)294 {295 $class = new \ReflectionClass($this->report);296 $method = $class->getMethod($name);297 $method->setAccessible(true);298 return $method;299 }300}...
report_construct.php
Source:report_construct.php
1<?2$MESS["REPORT_MODULE_NOT_INSTALLED"] = "The Report module is not installed.";3$MESS["CATALOG_MODULE_NOT_INSTALLED"] = "The Commercial Catalog module is not installed.";4$MESS["IBLOCK_MODULE_NOT_INSTALLED"] = "The Information Blocks module is not installed.";5$MESS["SALE_REPORT_CONSTRUCT_TITLE"] = "New report";6$MESS["SALE_REPORT_EDIT_TITLE"] = "Edit report";7$MESS["SALE_REPORT_CONSTRUCT_NEW_REPORT_TAB"] = "New report";8$MESS["SALE_REPORT_CONSTRUCT_EDIT_REPORT_TAB"] = "Edit report";9$MESS["SALE_REPORT_CONSTRUCT_NEW_REPORT_TITLE"] = "New report parameters";10$MESS["SALE_REPORT_CONSTRUCT_EDIT_REPORT_TITLE"] = "Report parameters";11$MESS["SALE_REPORT_CONSTRUCT_TITLE_LABEL"] = "Report name:";12$MESS["SALE_REPORT_CONSTRUCT_DESCRIPTION_LABEL"] = "Report description:";13$MESS["SALE_REPORT_CONSTRUCT_BUTTON_SAVE_LABEL"] = "Add";14$MESS["SALE_REPORT_CONSTRUCT_BUTTON_SAVE_LABEL_ON_EDIT"] = "Save Changes";15$MESS["SALE_REPORT_CONSTRUCT_BUTTON_SAVE_LABEL_ON_SELECT_HELPER"] = "Continue";16$MESS["SALE_REPORT_CONSTRUCT_BUTTON_SAVE_TITLE"] = "Add and return to reports list";17$MESS["SALE_REPORT_CONSTRUCT_BUTTON_SAVE_TITLE_ON_EDIT"] = "Save changes and return";18$MESS["SALE_REPORT_CONSTRUCT_BUTTON_SAVE_TITLE_ON_SELECT_HELPER"] = "Continue with this report";19$MESS["SALE_REPORT_CONSTRUCT_BUTTON_CANCEL_LABEL"] = "Cancel";20$MESS["SALE_REPORT_CONSTRUCT_BUTTON_CANCEL_TITLE"] = "Cancel and return";21$MESS["SALE_REPORT_CONSTRUCT_ERROR_ADD_REPORT"] = "Error adding a new report.";22$MESS["SALE_REPORT_CONSTRUCT_ERROR_EDIT_REPORT"] = "Error updating the report.";23$MESS["SALE_REPORT_CONSTRUCT_ERROR_EDIT_REPORT_ON_GET_PARAMS"] = "Error getting the report parameters for further update.";24$MESS["REPORT_POPUP_COLUMN_TITLE_sale_SaleOrder"] = "Order";25$MESS["REPORT_POPUP_COLUMN_TITLE_sale_User"] = "Customer";26$MESS["REPORT_POPUP_COLUMN_TITLE_sale_SaleFuser"] = "Visitor";27$MESS["REPORT_POPUP_COLUMN_TITLE_sale_SaleBasket"] = "Shopping cart";28$MESS["REPORT_POPUP_COLUMN_TITLE_sale_SaleProduct"] = "Product";29$MESS["REPORT_POPUP_FILTER_TITLE_sale_SaleOrder"] = "Order";30$MESS["REPORT_POPUP_FILTER_TITLE_sale_User"] = "Customer";31$MESS["REPORT_POPUP_FILTER_TITLE_sale_SaleFuser"] = "Visitor";32$MESS["REPORT_POPUP_FILTER_TITLE_sale_SaleBasket"] = "Shopping cart";33$MESS["REPORT_POPUP_FILTER_TITLE_sale_SaleProduct"] = "Product";34$MESS["SALE_REPORT_HELPER_SELECTOR_LABEL_TEXT"] = "Choose initial fields for use in a new report";35$MESS["REPORT_CALEND_MONTH"] = "this month";36$MESS["REPORT_CALEND_MONTH_AGO"] = "last month";37$MESS["REPORT_CALEND_WEEK"] = "this week";38$MESS["REPORT_CALEND_WEEK_AGO"] = "last week";39$MESS["REPORT_CALEND_DAYS"] = "last";40$MESS["REPORT_CALEND_AFTER"] = "after";41$MESS["REPORT_CALEND_BEFORE"] = "before";42$MESS["REPORT_CALEND_INTERVAL"] = "date range";43$MESS["REPORT_CALEND_ALL"] = "eternity";44$MESS["REPORT_CALEND_PICK_DATE"] = "Select date in calendar";45$MESS["REPORT_CALEND_REPORT_DAYS"] = "days";46$MESS["REPORT_NOT_FOUND"] = "Report ID \"%s\" was not found.";47$MESS["REPORT_VIEW_PERMISSION_DENIED"] = "Insufficient permissions to view the report.";48$MESS["REPORT_CSRF"] = "Security error submitting the form. Please try again.";49$MESS["REPORT_TITLE_NOT_SELECTED"] = "The report name is not specified.";50$MESS["REPORT_NO_COLUMN_SELECTED"] = "There are no columns selected.";51$MESS["REPORT_TITLE_COPY"] = "copy";52$MESS["REPORT_UNKNOWN_ERROR"] = "Unknown error.";53$MESS["REPORT_TITLE"] = "Report name";54$MESS["REPORT_DESCRIPTION"] = "Report description";55$MESS["REPORT_PERIOD"] = "Reporting period";56$MESS["REPORT_DEFAULT_TITLE"] = "New report";57$MESS["REPORT_COLUMNS"] = "Columns";58$MESS["REPORT_NEW_COLUMN_TITLE"] = "new name";59$MESS["REPORT_PRCNT_BUTTON_TITLE"] = "% of";60$MESS["REPORT_CHANGE_COLUMN_TITLE"] = "Change column name";61$MESS["REPORT_REMOVE_COLUMN"] = "Delete column";62$MESS["REPORT_CALC_COLUMN"] = "Calculate column";63$MESS["REPORT_ADD_SELECT_COLUMN"] = "Add";64$MESS["REPORT_SORT_BY_SELECT_COLUMN"] = "Sort by column";65$MESS["REPORT_SORT_TYPE_ASC"] = "ascending";66$MESS["REPORT_SORT_TYPE_DESC"] = "descending";67$MESS["REPORT_ADD"] = "Add";68$MESS["REPORT_CANCEL"] = "Cancel";69$MESS["REPORT_PRCNT_VIEW_IS_NOT_AVAILABLE"] = "Percent value cannot be derived for this column.";70$MESS["REPORT_FILTER"] = "Filter";71$MESS["REPORT_RESULT_LIMIT_BY"] = "Limit results by";72$MESS["REPORT_ANDOR_AND"] = "all";73$MESS["REPORT_ANDOR_OR"] = "any";74$MESS["REPORT_RESULT_LIMIT_CONDITION"] = "condition";75$MESS["REPORT_RESULT_LIMIT_CONDITIONS"] = "conditions";76$MESS["REPORT_CHOOSE_FIELD"] = "Select field";77$MESS["REPORT_ANDOR"] = "and / or";78$MESS["REPORT_ANDOR_ALL"] = "All";79$MESS["REPORT_ANDOR_ANY"] = "Any";80$MESS["REPORT_ANDOR_ALL_LABEL"] = "of the following conditions are true";81$MESS["REPORT_CHANGE_FILTER_IN_VIEW"] = "Change filter in report";82$MESS["REPORT_RESULT_LIMIT"] = "Maximum items";83$MESS["REPORT_CREATE_BUTTON"] = "Create report";84$MESS["REPORT_SAVE_BUTTON"] = "Save report";85$MESS["REPORT_SCHEME_PREVIEW"] = "Preview report structure";86$MESS["REPORT_PRCNT_BY_COLUMN"] = "% of column value";87$MESS["REPORT_PRCNT_BY_FIELD"] = "% of field value";88$MESS["REPORT_IGNORE_FILTER_VALUE"] = "Ignore";89$MESS["REPORT_BOOLEAN_VALUE_TRUE"] = "Yes";90$MESS["REPORT_BOOLEAN_VALUE_FALSE"] = "No";91$MESS["REPORT_CHOOSE"] = "Select";92$MESS["REPORT_RETURN_TO_LIST"] = "Back to reports";93$MESS["REPORT_SELECT_CALC_VAR_MIN"] = "Minimum";94$MESS["REPORT_SELECT_CALC_VAR_AVG"] = "Average";95$MESS["REPORT_SELECT_CALC_VAR_MAX"] = "Maximum";96$MESS["REPORT_SELECT_CALC_VAR_SUM"] = "Total";97$MESS["REPORT_SELECT_CALC_VAR_COUNT_DISTINCT"] = "Number of unique items";98$MESS["REPORT_FILTER_COMPARE_VAR_EQUAL"] = "Equal to";99$MESS["REPORT_FILTER_COMPARE_VAR_GREATER_OR_EQUAL"] = "More than or equal to";100$MESS["REPORT_FILTER_COMPARE_VAR_GREATER"] = "More than";101$MESS["REPORT_FILTER_COMPARE_VAR_LESS"] = "Less than";102$MESS["REPORT_FILTER_COMPARE_VAR_LESS_OR_EQUAL"] = "Less than or equal to";103$MESS["REPORT_FILTER_COMPARE_VAR_NOT_EQUAL"] = "Not equal";104$MESS["REPORT_FILTER_COMPARE_VAR_START_WITH"] = "Starts with";105$MESS["REPORT_FILTER_COMPARE_VAR_CONTAINS"] = "Contains";106$MESS["REPORT_FILTER_COMPARE_VAR_NOT_CONTAINS"] = "Doesn't contain";107$MESS["REPORT_ANDOR_ANY_LABEL"] = "of the following conditions are true";108$MESS["SALE_REPORT_CONSTRUCT_CATALOG_NAME_LABEL"] = "Catalog";109$MESS["SALE_REPORT_DEFAULT_CAN_NOT_BE_EDITED"] = "The default report cannot be modified.";...
report.go
Source:report.go
1package dao2import (3 "go-common/app/admin/ep/melloi/model"4)5// QueryReportSummarys query reportSummarys6func (d *Dao) QueryReportSummarys(reportSummary *model.ReportSummary, searchAll bool, pn, ps int32, treeNodes []string) (qrsr *model.QueryReportSuResponse, err error) {7 qrsr = &model.QueryReportSuResponse{}8 reportSummary.Active = 19 reportSummary.Debug = -110 gDB := d.DB.Table(model.ReportSummary{}.TableName()) //.Where("app in (?)", treeNodes)11 if reportSummary.TestName != "" && reportSummary.ScriptID != 0 {12 gDB = gDB.Where("test_name LIKE ? and active = ? and debug = ? and script_id = ?", "%"+reportSummary.TestName+"%", 1, -1, reportSummary.ScriptID)13 }14 if reportSummary.UserName != "" && reportSummary.ScriptID != 0 {15 gDB = gDB.Where("user_name LIKE ? and active = ? and debug = ? and script_id = ?", "%"+reportSummary.UserName+"%", 1, -1, reportSummary.ScriptID)16 }17 if reportSummary.TestName != "" {18 gDB = gDB.Where("test_name LIKE ? and active = ? and debug = ?", "%"+reportSummary.TestName+"%", 1, -1)19 }20 if reportSummary.UserName != "" {21 gDB = gDB.Where("user_name LIKE ? and active = ? and debug = ?", "%"+reportSummary.UserName+"%", 1, -1)22 }23 if searchAll {24 gDB = gDB.Where("type in (0, 1, 2)")25 } else {26 if reportSummary.ID == 0 {27 gDB = gDB.Where("type = ?", reportSummary.Type)28 }29 }30 if reportSummary.TestName == "" && reportSummary.UserName == "" {31 gDB = gDB.Where(reportSummary)32 }33 err = gDB.Count(&qrsr.TotalSize).34 Order("ctime desc").Offset((pn - 1) * ps).Limit(ps).Find(&qrsr.ReportSummarys).Error35 qrsr.PageSize = ps /**/36 qrsr.PageNum = pn37 return38}39// QueryReportSummarysWhiteName query reportSummarys by whiteName40func (d *Dao) QueryReportSummarysWhiteName(reportSummary *model.ReportSummary, searchAll bool, pn, ps int32) (qrsr *model.QueryReportSuResponse, err error) {41 qrsr = &model.QueryReportSuResponse{}42 reportSummary.Active = 143 reportSummary.Debug = -144 gDB := d.DB.Table(model.ReportSummary{}.TableName())45 if reportSummary.TestName != "" && reportSummary.ScriptID != 0 {46 gDB = gDB.Where("test_name LIKE ? and active = ? and debug = ? and script_id = ?", "%"+reportSummary.TestName+"%", 1, -1, reportSummary.ScriptID)47 }48 if reportSummary.UserName != "" && reportSummary.ScriptID != 0 {49 gDB = gDB.Where("user_name LIKE ? and active = ? and debug = ? and script_id = ?", "%"+reportSummary.UserName+"%", 1, -1, reportSummary.ScriptID)50 }51 if reportSummary.TestName != "" {52 gDB = gDB.Where("test_name LIKE ? and active = ? and debug = ?", "%"+reportSummary.TestName+"%", 1, -1)53 }54 if reportSummary.UserName != "" {55 gDB = gDB.Where("user_name LIKE ? and active = ? and debug = ?", "%"+reportSummary.UserName+"%", 1, -1)56 }57 if searchAll {58 gDB = gDB.Where("type in (0, 1, 2)")59 } else {60 if reportSummary.ID == 0 {61 gDB = gDB.Where("type = ?", reportSummary.Type)62 }63 }64 if reportSummary.TestName == "" && reportSummary.UserName == "" {65 gDB = gDB.Where(reportSummary)66 }67 err = gDB.Count(&qrsr.TotalSize).68 Order("ctime desc").Offset((pn - 1) * ps).Limit(ps).Find(&qrsr.ReportSummarys).Error69 qrsr.PageSize = ps /**/70 qrsr.PageNum = pn71 return72}73// QueryReportSurys query reportSummarys74func (d *Dao) QueryReportSurys(reportSummary *model.ReportSummary) (res []*model.ReportSummary, err error) {75 err = d.DB.Table(model.ReportSummary{}.TableName()).Where(reportSummary).Find(&res).Error76 return77}78// QueryReportSuryByID query reportSummary by id79func (d *Dao) QueryReportSuryByID(id int) (res *model.ReportSummary, err error) {80 reportSummary := model.ReportSummary{ID: id}81 res = &model.ReportSummary{}82 err = d.DB.Table(model.ReportSummary{}.TableName()).Where(reportSummary).First(&res).Error83 return84}85//CountQueryReportSummarys count queryReportSummarys86func (d *Dao) CountQueryReportSummarys(reportSummary *model.ReportSummary) (total int, err error) {87 err = d.DB.Table(model.ReportSummary{}.TableName()).Where(reportSummary).Count(&total).Error88 return89}90//AddReportSummary add reportSummary91func (d *Dao) AddReportSummary(reportSummary *model.ReportSummary) (reportSuID int, err error) {92 err = d.DB.Create(reportSummary).Error93 reportSuID = reportSummary.ID94 return95}96//UpdateReportSummary update Report97func (d *Dao) UpdateReportSummary(reportSummary *model.ReportSummary) error {98 return d.DB.Model(&model.ReportSummary{}).Where("id = ?", reportSummary.ID).Updates(reportSummary).Error99}100//UpdateReportStatusByID update report status101func (d *Dao) UpdateReportStatusByID(ID, testStatus int) error {102 return d.DB.Exec("update report_summary set test_status = ? where id = ? ", testStatus, ID).Error103}104//UpdateReportStatus update Report105func (d *Dao) UpdateReportStatus(status int) error {106 return d.DB.Model(&model.ReportSummary{}).Where("test_status = 2").Update("test_status", 1).Error107}108//UpdateReportDockByID update Report109func (d *Dao) UpdateReportDockByID(ID, dockerSum int) error {110 return d.DB.Model(&model.ReportSummary{}).Where("id =?", ID).Updates(model.ReportSummary{DockerSum: dockerSum}).Error111}112//DelReportSummary delete reportSummary113func (d *Dao) DelReportSummary(id int) error {114 return d.DB.Model(&model.ReportSummary{}).Where("ID=?", id).Update("active", 0).Error115}116//QueryReTimely query rueryReTimely117func (d *Dao) QueryReTimely(testName, beginTime, afterTime string, podNames []string) (reportTimelys []*model.ReportTimely, err error) {118 err = d.DB.Model(&model.ReportTimely{}).Where("test_name = ? and mtime >= ? and mtime <= ? and pod_name in (?)", testName, beginTime, afterTime, podNames).Find(&reportTimelys).Error119 return120}...
template.php
Source:template.php
1<?2$MESS["REPORT_CONSTRUCT"] = "Report Wizard";3$MESS["REPORT_TITLE"] = "Report name";4$MESS["REPORT_DEFAULT_TITLE"] = "New report";5$MESS["REPORT_PERIOD"] = "Reporting period";6$MESS["REPORT_COLUMNS"] = "Columns";7$MESS["REPORT_CALC_COLUMN"] = "Calculate column";8$MESS["REPORT_ADD_SELECT_COLUMN"] = "Add";9$MESS["REPORT_SORT_BY_SELECT_COLUMN"] = "Sort by column";10$MESS["REPORT_SORT_TYPE_ASC"] = "ascending";11$MESS["REPORT_SORT_TYPE_DESC"] = "descending";12$MESS["REPORT_FILTER"] = "Filter";13$MESS["REPORT_RESULT_LIMIT_BY"] = "Limit results by";14$MESS["REPORT_RESULT_LIMIT_CONDITIONS"] = "conditions";15$MESS["REPORT_RESULT_LIMIT_CONDITION"] = "condition";16$MESS["REPORT_CALEND_MONTH"] = "this month";17$MESS["REPORT_CALEND_MONTH_AGO"] = "last month";18$MESS["REPORT_CALEND_WEEK"] = "this week";19$MESS["REPORT_CALEND_WEEK_AGO"] = "last week";20$MESS["REPORT_CALEND_DAYS"] = "last";21$MESS["REPORT_CALEND_AFTER"] = "after";22$MESS["REPORT_CALEND_BEFORE"] = "before";23$MESS["REPORT_CALEND_INTERVAL"] = "date range";24$MESS["REPORT_CALEND_PICK_DATE"] = "Select date in calendar";25$MESS["REPORT_CALEND_REPORT_DAYS"] = "days";26$MESS["REPORT_SELECT_CALC_VAR_MIN"] = "Minimum";27$MESS["REPORT_SELECT_CALC_VAR_AVG"] = "Average";28$MESS["REPORT_SELECT_CALC_VAR_MAX"] = "Maximum";29$MESS["REPORT_SELECT_CALC_VAR_SUM"] = "Total";30$MESS["REPORT_SELECT_CALC_VAR_COUNT_DISTINCT"] = "Unique";31$MESS["REPORT_FILTER_COMPARE_VAR_EQUAL"] = "is equal to";32$MESS["REPORT_FILTER_COMPARE_VAR_GREATER_OR_EQUAL"] = "is more than or equal to";33$MESS["REPORT_FILTER_COMPARE_VAR_GREATER"] = "is more than";34$MESS["REPORT_FILTER_COMPARE_VAR_LESS"] = "is less than";35$MESS["REPORT_FILTER_COMPARE_VAR_LESS_OR_EQUAL"] = "is less than or equal to";36$MESS["REPORT_FILTER_COMPARE_VAR_NOT_EQUAL"] = "is not equal";37$MESS["REPORT_FILTER_COMPARE_VAR_START_WITH"] = "starts with";38$MESS["REPORT_FILTER_COMPARE_VAR_CONTAINS"] = "contains";39$MESS["REPORT_FILTER_COMPARE_VAR_NOT_CONTAINS"] = "doesn't contain";40$MESS["REPORT_NEW_COLUMN_TITLE"] = "new name";41$MESS["REPORT_CHANGE_COLUMN_TITLE"] = "Change column name";42$MESS["REPORT_REMOVE_COLUMN"] = "Delete column";43$MESS["REPORT_ADD"] = "Add";44$MESS["REPORT_CANCEL"] = "Cancel";45$MESS["REPORT_ANDOR_OR"] = "any";46$MESS["REPORT_ANDOR_AND"] = "all";47$MESS["REPORT_ANDOR"] = "and / or";48$MESS["REPORT_ANDOR_ALL"] = "All";49$MESS["REPORT_ANDOR_ANY"] = "Any";50$MESS["REPORT_ANDOR_ALL_LABEL"] = "of the following conditions are true";51$MESS["REPORT_ANDOR_ANY_LABEL"] = "of the following conditions are true";52$MESS["REPORT_CHOOSE_FIELD"] = "Select field";53$MESS["REPORT_CHANGE_FILTER_IN_VIEW"] = "Change filter in report";54$MESS["REPORT_RESULT_LIMIT"] = "Maximum items";55$MESS["REPORT_SAVE_BUTTON"] = "Save report";56$MESS["REPORT_CREATE_BUTTON"] = "Create report";57$MESS["REPORT_SCHEME_PREVIEW"] = "Preview report structure";58$MESS["REPORT_BOOLEAN_VALUE_TRUE"] = "Yes";59$MESS["REPORT_BOOLEAN_VALUE_FALSE"] = "No";60$MESS["REPORT_CHOOSE"] = "Select";61$MESS["REPORT_DELETE_CONFIRM"] = "Are you sure you want to delete the report \"%s\"?";62$MESS["REPORT_DELETE_BUTTON"] = "Delete";63$MESS["REPORT_DELETE_CANCEL"] = "Cancel";64$MESS["REPORT_RETURN_TO_LIST"] = "Back to reports";65$MESS["REPORT_PRCNT_VIEW_IS_NOT_AVAILABLE"] = "Percent value cannot be derived for this column.";66$MESS["REPORT_PRCNT_BY_COLUMN"] = "% of column value";67$MESS["REPORT_PRCNT_BY_FIELD"] = "% of field value";68$MESS["REPORT_PRCNT_BUTTON_TITLE"] = "% of";69$MESS["REPORT_IGNORE_FILTER_VALUE"] = "Ignore";70$MESS["REPORT_CALEND_ALL"] = "all";71$MESS["REPORT_DESCRIPTION"] = "Report description";72$MESS["REPORT_SELECT_CALC_VAR_GROUP_CONCAT"] = "Print all existing items";73$MESS["REPORT_RESULT_COLUMN_FILTER"] = "Report fields";74$MESS["SALE_REPORT_SITE"] = "Web store report";75$MESS["TASKS_PICK_DATE"] = "Select date in calendar";76$MESS["REPORT_NEGATIVE_VALUES_RED"] = "Print negative values in red";77$MESS["REPORT_GROUP_RESULT_BY_COLUMN"] = "Group result by column";78$MESS["REPORT_GROUP_RESULT_SUBTOTAL"] = "Show subtotal";79$MESS["REPORT_HELPER_SPEC_UCSPT"] = "Use price type column selector in report";80$MESS["REPORT_CHART_DISPLAY"] = "Show chart";81$MESS["REPORT_CHART_TYPE_LABEL_TEXT"] = "Chart type";82$MESS["REPORT_CHART_LABEL_TEXT_ARGS"] = "Arguments";83$MESS["REPORT_CHART_LABEL_TEXT_VALUES"] = "Values";84$MESS["REPORT_CHART_ADD_COL_LABEL_TITLE"] = "Add value column";85$MESS["REPORT_CHART_REMOVE_COL_LABEL_TITLE"] = "Delete value column";86$MESS["REPORT_MOBILE_SETTINGS"] = "Use in mobile version";...
report
Using AI Code Generation
1use \mageekguy\atoum\reports\realtime;2use \mageekguy\atoum\writers\std\out;3use \mageekguy\atoum\reports\asynchronous;4$report = new realtime();5$report->addWriter(new out());6$runner->addReport($report);
report
Using AI Code Generation
1$report = new \mageekguy\atoum\reports\realtime\cli();2$runner->addReport($report);3$report = new \mageekguy\atoum\reports\realtime\cli();4$runner->addReport($report);5$report = new \mageekguy\atoum\reports\realtime\cli();6$runner->addReport($report);7$report = new \mageekguy\atoum\reports\realtime\cli();8$runner->addReport($report);9$report = new \mageekguy\atoum\reports\realtime\cli();10$runner->addReport($report);11$report = new \mageekguy\atoum\reports\realtime\cli();12$runner->addReport($report);13$report = new \mageekguy\atoum\reports\realtime\cli();14$runner->addReport($report);15$report = new \mageekguy\atoum\reports\realtime\cli();16$runner->addReport($report);17$report = new \mageekguy\atoum\reports\realtime\cli();18$runner->addReport($report);19$report = new \mageekguy\atoum\reports\realtime\cli();20$runner->addReport($report);21$report = new \mageekguy\atoum\reports\realtime\cli();22$runner->addReport($report
report
Using AI Code Generation
1use \mageekguy\atoum\reports\realtime;2use \mageekguy\atoum\reports\asynchronous;3$script->addDefaultReport();4$realtimeReport = new realtime\cli();5$realtimeReport->addWriter(new realtime\cli\writer());6$script->addReport($realtimeReport);7$asynchronousReport = new asynchronous\cli();8$asynchronousReport->addWriter(new asynchronous\cli\writer());9$script->addReport($asynchronousReport);
report
Using AI Code Generation
1require_once 'atoum/report/field.php';2require_once 'atoum/report/fields.php';3require_once 'atoum/report.php';4require_once 'atoum/report/fields/runner.php';5require_once 'atoum/report/fields/test.php';6require_once 'atoum/report/fields/test/void.php';7require_once 'atoum/report/fields/test/exception.php';8require_once 'atoum/report/fields/test/out.php';9require_once 'atoum/report/fields/test/err.php';10require_once 'atoum/report/fields/test/runner.php';11require_once 'atoum/report/fields/test/coverage.php';12require_once 'atoum/report/fields/test/coverage/html.php';13require_once 'atoum/report/fields/test/coverage/clover.php';14require_once 'atoum/report/fields/test/coverage/php.php';15require_once 'atoum/report/fields/test/coverage/terminal.php';16require_once 'atoum/report/fields/test/coverage/xml.php';17require_once 'atoum/report/fields/test/void.php';18require_once 'atoum/report/fields/test/exception.php';19require_once 'atoum/report/fields/test/out.php';20require_once 'atoum/report/fields/test/err.php';21require_once 'atoum/report/fields/test/runner.php';22require_once 'atoum/report/fields/test/coverage.php';23require_once 'atoum/report/fields/test/coverage/html.php';24require_once 'atoum/report/fields/test/coverage/clover.php';25require_once 'atoum/report/fields/test/coverage/php.php';26require_once 'atoum/report/fields/test/coverage/terminal.php';27require_once 'atoum/report/fields/test/coverage/xml.php';28require_once 'atoum/report/fields/test/void.php';29require_once 'atoum/report/fields/test/exception.php';30require_once 'atoum/report/fields/test/out.php';31require_once 'atoum/report/fields/test/err.php';32require_once 'atoum/report/fields/test/runner.php';33require_once 'atoum/report/fields/test/coverage.php';34require_once 'atoum/report/fields/test/coverage/html.php';35require_once 'atoum/report/fields/test/coverage/clover.php';
report
Using AI Code Generation
1$report = new atoum\report();2$report->addWriter(new atoum\writers\std\out());3$runner = new atoum\runner();4$runner->setReport($report);5$runner->addTestsFromDirectory(__DIR__.'/tests/units/');6$runner->run();7namespace Tests\Units;8{9 public function test1()10 {11 $this->boolean(true)->isTrue();12 }13}
report
Using AI Code Generation
1use atoum\atoum\reports;2use atoum\atoum\report\fields;3use atoum\atoum\reports;4use atoum\atoum\report\fields;5use atoum\atoum\reports;6use atoum\atoum\report\fields;7use atoum\atoum\reports;8use atoum\atoum\report\fields;9use atoum\atoum\reports;10use atoum\atoum\report\fields;11use atoum\atoum\reports;12use atoum\atoum\report\fields;13use atoum\atoum\reports;14use atoum\atoum\report\fields;15use atoum\atoum\reports;16use atoum\atoum\report\fields;17use atoum\atoum\reports;18use atoum\atoum\report\fields;19use atoum\atoum\reports;20use atoum\atoum\report\fields;21use atoum\atoum\reports;22use atoum\atoum\report\fields;23use atoum\atoum\reports;24use atoum\atoum\report\fields;25use atoum\atoum\reports;26use atoum\atoum\report\fields;27use atoum\atoum\reports;28use atoum\atoum\report\fields;
report
Using AI Code Generation
1use atoum\report;2$report = new report();3$report->addWriter(new atoum\writers\std\out());4$runner->addReport($report);5$runner->run();6use atoum\report;7$report = new report();8$report->addWriter(new atoum\writers\std\out());9$runner->addReport($report);10$runner->run();11use atoum\report;12$report = new report();13$report->addWriter(new atoum\writers\html());14$runner->addReport($report);15$runner->run();16use atoum\report;17$report = new report();18$report->addWriter(new atoum\writers\html());19$runner->addReport($report);20$runner->run();21use atoum\report;22$report = new report();
report
Using AI Code Generation
1use \mageekguy\atoum\reports\realtime;2$report = new realtime\cli();3$runner->addReport($report);4$script->run();5use \mageekguy\atoum\reports\realtime;6$report = new realtime\html();7$runner->addReport($report);8$script->run();9use \mageekguy\atoum\reports\realtime;10$report = new realtime\cli();11$runner->addReport($report);12$script->run();13use \mageekguy\atoum\reports\realtime;14$report = new realtime\html();15$runner->addReport($report);16$script->run();17use \mageekguy\atoum\reports\realtime;18$report = new realtime\cli();19$runner->addReport($report);20$script->run();21use \mageekguy\atoum\reports\realtime;22$report = new realtime\html();23$runner->addReport($report);24$script->run();25use \mageekguy\atoum\reports\realtime;26$report = new realtime\cli();27$runner->addReport($report);28$script->run();
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.
Test now for FreeGet 100 minutes of automation test minutes FREE!!