Skip to content

Commit f75681c

Browse files
committed
Banner message change
Better work with nonexist action call exception
1 parent bed4bd4 commit f75681c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/AbraFlexi/RO.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ public function setDataValue(string $columnName, $value) {
652652
}
653653
return $result;
654654
}
655-
655+
656656
/**
657657
* Strip all non-identifier data
658658
*
@@ -664,7 +664,7 @@ public function stripBody(array $keep = []) {
664664
$extIds = $this->getExternalIDs();
665665
$restoreData = [];
666666
$originalData = $this->getData();
667-
foreach ($keep as $column){
667+
foreach ($keep as $column) {
668668
\Ease\Functions::divDataArray($originalData, $restoreData, $column);
669669
}
670670
$this->dataReset();
@@ -1193,7 +1193,7 @@ public function parseResponse($responseDecoded, $responseCode) {
11931193
$this->addStatusMessage($this->lastResponseCode . ': ' . $this->curlInfo['url'] . ' (' . $this->format . ') ' . json_encode($this->getErrors()), 'warning');
11941194
if ($this->throwException) {
11951195
$errors = $this->getErrors();
1196-
throw new Exception( empty($errors) ? 'Problem ' : $errors[0]['message'] , $this);
1196+
throw new Exception(empty($errors) ? 'Problem ' : $errors[0]['message'], $this);
11971197
}
11981198
break;
11991199
}
@@ -2801,7 +2801,7 @@ function ($key) {
28012801
public function logBanner($prefix = null, $suffix = null) {
28022802
parent::logBanner($prefix,
28032803
'ServerURL ' . str_replace('://', '://' . $this->user . '@',
2804-
$this->getApiUrl()) . ' library v' . self::$libVersion . ' (AbraFlexi ' . EvidenceList::$version . ')', $suffix);
2804+
$this->getApiUrl()) . ' php-abraflexi v' . self::$libVersion . ' (AbraFlexi ' . EvidenceList::$version . ')', $suffix);
28052805
}
28062806

28072807
/**

testing/src/AbraFlexi/ROTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,20 @@ protected function tearDown(): void {
6161

6262
}
6363

64+
private function withEvidenceOnly() {
65+
if (empty($this->object->getEvidence())) {
66+
$this->markTestSkipped('Evidence is not set');
67+
}
68+
}
69+
6470
/**
6571
* @covers AbraFlexi\AbraFlexiRO::logBanner
6672
*/
6773
public function testLogBanner() {
74+
\Ease\Logger\Regent::singleton()->cleanMessages();
6875
$this->object->logBanner(addslashes(get_class($this)));
76+
$messages = \Ease\Logger\Regent::singleton()->getMessages();
77+
$this->assertFalse(empty(strstr($messages[0]->body, 'ServerURL http')));
6978
}
7079

7180
/**
@@ -112,6 +121,7 @@ public function testCurlInit() {
112121
* @covers AbraFlexi\AbraFlexiRO::processInit
113122
*/
114123
public function testProcessInit() {
124+
115125
$this->object->processInit(1);
116126
$this->object->processInit(['id' => 1]);
117127
$this->assertEquals(1, $this->object->getDataValue('id'));

0 commit comments

Comments
 (0)