• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

eiriksm / finn-transfer-sdk / 11610157798

31 Oct 2024 10:23AM UTC coverage: 70.889% (+1.1%) from 69.78%
11610157798

push

github

web-flow
October 2024 changes (#19)

23 of 24 new or added lines in 7 files covered. (95.83%)

526 of 742 relevant lines covered (70.89%)

2.87 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/src/AdTypes/ThreshingMachineXml.php
1
<?php
2

3
namespace eiriksm\FinnTransfer\AdTypes;
4

5
use eiriksm\FinnTransfer\AdType;
6
use eiriksm\FinnTransfer\Traits\ModelPropertyTrait;
7

8
class ThreshingMachineXml extends AdType
9
{
10
    use ModelPropertyTrait;
11

12
    protected $dtd = 'https://www.iad.no/dtd/IADIF-threshing_machine-24.dtd';
13

14
    protected $documentType = 'IAD.IF.THRESHING_MACHINE';
15

16
    protected $adBodyTag = 'THRESHING_MACHINE';
17

18
    public function __construct($partner_id, $provider)
19
    {
20
        parent::__construct($partner_id, $provider);
2✔
21
        $this->createModelProperty('AGRI_THRESHING_MODEL');
2✔
22
        $this->adBody->appendChild($this->modelOuterBody);
2✔
23
        $this->YEAR_MODEL = '';
2✔
24
        $this->HOURS_USED = '';
2✔
25
        $this->createMotorPriceElements(true);
2✔
26
        $this->createEngineElements();
2✔
27
        $this->WEIGHT = '';
2✔
28
        $this->TRESHING_MACHINE_EQUIPMENT = '';
2✔
29
        $this->DESCRIPTION = '';
2✔
30
        $this->createMoreInfoElements();
2✔
31
        $this->initializeContact();
2✔
32
        $this->VIDEO_URL = '';
2✔
33
    }
34

35
    public function __set($name, $value)
36
    {
37
        if ($name == 'MILEAGE') {
2✔
38
          // Not allowed for this ad type.
39
            return;
×
40
        }
41
        parent::__set($name, $value);
2✔
42
    }
43

44
    public function setSegment($segment)
45
    {
46
      // Empty on purpose. There is no segment.
NEW
47
    }
×
48

49
    public function addEquipment($equipment_items)
50
    {
51
        // Remove initial empty tag.
52
        $tags = $this->dom->getElementsByTagName('TRESHING_MACHINE_EQUIPMENT');
1✔
53
        // We have only 1 initial tag.
54
        $tag = $tags->item(0);
1✔
55
        $tag->parentNode->removeChild($tag);
1✔
56

57
        // Set values.
58
        foreach ($equipment_items as $equipment_value) {
1✔
59
            $equipment_el = $this->dom->createElement('TRESHING_MACHINE_EQUIPMENT');
1✔
60
            $equipment_el->nodeValue = $equipment_value;
1✔
61
            $this->customTags['DESCRIPTION']->parentNode->insertBefore($equipment_el, $this->customTags['DESCRIPTION']);
1✔
62
        }
63
    }
64
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc