|
@@ 71-78 (lines=8) @@
|
| 68 |
|
/** |
| 69 |
|
* @Given /(\S+) (\S+) price is ([0-9.]+) (\w+) per (\w+)/ |
| 70 |
|
*/ |
| 71 |
|
public function priceIs($target, $type, $sum, $currency, $unit) |
| 72 |
|
{ |
| 73 |
|
$type = new Type(Type::ANY, $type); |
| 74 |
|
$target = new Target(Target::ANY, $target); |
| 75 |
|
$quantity = Quantity::create($unit, 0); |
| 76 |
|
$sum = $this->moneyParser->parse($sum, $currency); |
| 77 |
|
$this->price = new SinglePrice(null, $type, $target, null, $quantity, $sum); |
| 78 |
|
} |
| 79 |
|
|
| 80 |
|
/** |
| 81 |
|
* @Given /action is (\S+) (\w+) ([0-9.]+) (\S+)/ |
|
@@ 83-90 (lines=8) @@
|
| 80 |
|
/** |
| 81 |
|
* @Given /action is (\S+) (\w+) ([0-9.]+) (\S+)/ |
| 82 |
|
*/ |
| 83 |
|
public function actionIs($target, $type, $amount, $unit) |
| 84 |
|
{ |
| 85 |
|
$type = new Type(Type::ANY, $type); |
| 86 |
|
$target = new Target(Target::ANY, $target); |
| 87 |
|
$quantity = Quantity::create($unit, $amount); |
| 88 |
|
$time = new DateTimeImmutable(); |
| 89 |
|
$this->action = new Action(null, $type, $target, $quantity, $this->customer, $time); |
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
/** |
| 93 |
|
* @Given /formula is (.+)/ |