Skip to content

Commit d118633

Browse files
committed
bodyStripper added
1 parent 91be9bb commit d118633

File tree

4 files changed

+102
-3
lines changed

4 files changed

+102
-3
lines changed

debian/changelog

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
php-spojenet-abraflexi (2.16) UNRELEASED; urgency=medium
1+
php-spojenet-abraflexi (2.17) UNRELEASED; urgency=medium
22

33
[ Vítězslav Dvořák ]
44
* ease-core based
@@ -37,8 +37,9 @@ php-spojenet-abraflexi (2.16) UNRELEASED; urgency=medium
3737
* v2.14 release
3838
* Relation class introduced
3939
* Relations recovered
40+
* body stripper added
4041

41-
-- vitex <[email protected]> Sun, 17 Oct 2021 15:19:51 +0200
42+
-- vitex <[email protected]> Tue, 19 Oct 2021 20:00:03 +0200
4243

4344
flexipeehp (1.12) experimental; urgency=medium
4445

src/AbraFlexi/RO.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,12 +655,20 @@ public function setDataValue(string $columnName, $value) {
655655

656656
/**
657657
* Strip all non-identifier data
658+
*
659+
* @param array $keep extra columns to be preserved
658660
*/
659-
public function stripBody() {
661+
public function stripBody(array $keep = []) {
660662
$id = $this->getRecordID();
661663
$code = $this->getRecordCode();
662664
$extIds = $this->getExternalIDs();
665+
$restoreData = [];
666+
$originalData = $this->getData();
667+
foreach ($keep as $column){
668+
\Ease\Functions::divDataArray($originalData, $restoreData, $column);
669+
}
663670
$this->dataReset();
671+
$this->setData($restoreData);
664672
$this->setMyKey($id);
665673
$columns = $this->getColumnsInfo();
666674
if (array_key_exists('kod', $columns)) {
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
3+
namespace Test\AbraFlexi;
4+
5+
use AbraFlexi\DateTime;
6+
7+
/**
8+
* Generated by PHPUnit_SkeletonGenerator on 2021-10-19 at 15:21:39.
9+
*/
10+
class DateTimeTest extends \PHPUnit\Framework\TestCase {
11+
12+
/**
13+
* @var DateTime
14+
*/
15+
protected $object;
16+
17+
/**
18+
* Sets up the fixture, for example, opens a network connection.
19+
* This method is called before a test is executed.
20+
*/
21+
protected function setUp(): void {
22+
$this->object = new DateTime();
23+
}
24+
25+
/**
26+
* Tears down the fixture, for example, closes a network connection.
27+
* This method is called after a test is executed.
28+
*/
29+
protected function tearDown(): void {
30+
31+
}
32+
33+
/**
34+
* Test Constructor
35+
*
36+
* @covers AbraFlexi\Date::__construct
37+
*/
38+
public function testConstructor() {
39+
$classname = get_class($this->object);
40+
41+
// Get mock, without the constructor being called
42+
$mock = $this->getMockBuilder($classname)
43+
->disableOriginalConstructor()
44+
->getMockForAbstractClass();
45+
46+
$mock->__construct('');
47+
$this->assertTrue($mock->isNull);
48+
49+
$mock->__construct('NOW');
50+
$this->assertFalse($mock->isNull);
51+
52+
$mock->__construct('2021-10-19T15:12:53.435+02:00');
53+
}
54+
55+
56+
57+
/**
58+
* @covers AbraFlexi\Date::__toString
59+
*/
60+
public function test__toString() {
61+
$this->assertEquals(date('Y-m-d'), $this->object->__toString());
62+
}
63+
64+
65+
}

tools/update_properties_class.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,31 @@ class Properties
103103
"url"=> "http:\/\/demo.flexibee.eu\/c\/demo\/faktura-vydana-polozka",
104104
"links" => null
105105
];
106+
107+
$structure['typDoklBan'] = [
108+
"showToUser" => "true",
109+
"propertyName" => "typDoklBan",
110+
"fkEvidencePath" => 'typDoklBan',
111+
"name" => "typDoklBan",
112+
"title" => "typDoklBan",
113+
"type" => "relation",
114+
"isVisible" => "true",
115+
"isSortable" => "false",
116+
"isHighlight" => "false",
117+
"inId" => "false",
118+
"inSummary" => "true",
119+
"inDetail" => "true",
120+
"inExpensive" => "true",
121+
"mandatory" => "false",
122+
"isWritable" => "true",
123+
"isOverWritable" => "true",
124+
"hasBusinessLogic" => "false",
125+
"isUpperCase" => "false",
126+
"isLowerCase" => "false",
127+
"url"=> "http:\/\/demo.flexibee.eu\/c\/demo\/faktura-vydana-polozka",
128+
"links" => null
129+
];
130+
106131
}
107132

108133

0 commit comments

Comments
 (0)