1 | <?php |
||
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 = '') |
||
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') |
||
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 = '.') |
||
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 = ',') |
||
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() |
||
64 | } |
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
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. 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.