Completed
Branch BUG-10636-remove-unnecessary-b... (5637a2)
by
unknown
12:42 queued 13s
created

setCurrencyThousandsSeparatorTo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
namespace EventEspresso\Codeception\helpers;
3
4
use Page\CoreAdmin;
5
use Page\CountrySettingsAdmin as CountrySettings;
6
7
trait CountrySettingsAdmin
8
{
9
    /**
10
     * Instructs the actor to browse to the country settings page.
11
     * Assumes the actor is already logged in.
12
     * @param string $additional_params
13
     */
14
    public function amOnCountrySettingsAdminPage($additional_params = '')
15
    {
16
        $this->actor()->amOnAdminPage(CountrySettings::url($additional_params));
0 ignored issues
show
Bug introduced by
It seems like actor() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
17
    }
18
19
20
    /**
21
     * Instructs the actor to select the given decimal places radio option.
22
     * Assumes the actor is already on the country settings page.
23
     * @param string $decimal_places
24
     * @param string $country_code
25
     */
26
    public function setCurrencyDecimalPlacesTo($decimal_places = '2', $country_code = 'US')
27
    {
28
        $this->actor()->click(CountrySettings::currencyDecimalPlacesRadioField($decimal_places, $country_code));
0 ignored issues
show
Bug introduced by
It seems like actor() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
29
    }
30
31
32
    /**
33
     * Instructs the actor to select the given decimal mark radio option.
34
     * Assumes the actor is already on the country settings page.
35
     * @param string $decimal_mark
36
     */
37
    public function setCurrencyDecimalMarkTo($decimal_mark = '.')
38
    {
39
        $this->actor()->click(CountrySettings::currencyDecimalMarkRadioField($decimal_mark));
0 ignored issues
show
Bug introduced by
It seems like actor() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
40
    }
41
42
43
    /**
44
     * Instructs the actor to select the given thousands separator radio option.
45
     * Assumes the actor is already on the country settings page.
46
     * @param string $thousands_seperator
47
     */
48
    public function setCurrencyThousandsSeparatorTo($thousands_seperator = ',')
49
    {
50
        $this->actor()->click(CountrySettings::currencyThousandsSeparatorField($thousands_seperator));
0 ignored issues
show
Bug introduced by
It seems like actor() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
51
    }
52
53
54
    /**
55
     * Clicks the country settings submit button.
56
     * Assumes the actor is on the country settings admin page.
57
     */
58
    public function saveCountrySettings()
59
    {
60
        $this->actor()->click(CountrySettings::COUNTRY_SETTINGS_SAVE_BUTTON);
0 ignored issues
show
Bug introduced by
It seems like actor() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
61
        //no indicator on the page when stuff has been updated so just give a bit of time for it to finish.
62
        $this->actor()->wait(5);
0 ignored issues
show
Bug introduced by
It seems like actor() must be provided by classes using this trait. How about adding it as abstract method to this trait?

This check looks for methods that are used by a trait but not required by it.

To illustrate, let’s look at the following code example

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). If this method does not exist on a class mixing in this trait, the method will fail.

Adding the getId() as an abstract method to the trait will make sure it is available.

Loading history...
63
    }
64
}