| @@ 34-47 (lines=14) @@ | ||
| 31 | } |
|
| 32 | ||
| 33 | /** @test */ |
|
| 34 | public function it_replace_from_values_relations() |
|
| 35 | { |
|
| 36 | $notification = [ |
|
| 37 | 'body' => [ |
|
| 38 | 'text' => 'Hi {to.username} hello', |
|
| 39 | ], |
|
| 40 | 'to' => [ |
|
| 41 | 'username' => 'jhon', |
|
| 42 | ], |
|
| 43 | 'extra' => null, |
|
| 44 | ]; |
|
| 45 | ||
| 46 | $this->parse($notification)->shouldReturn('Hi jhon hello'); |
|
| 47 | } |
|
| 48 | ||
| 49 | /** @test */ |
|
| 50 | public function it_replace_both_in_a_string() |
|
| @@ 68-83 (lines=16) @@ | ||
| 65 | } |
|
| 66 | ||
| 67 | /** @test */ |
|
| 68 | public function it_replace_property_name_of_current_object() |
|
| 69 | { |
|
| 70 | $this->url = 'http://localhost'; |
|
| 71 | ||
| 72 | $notification = [ |
|
| 73 | 'body' => [ |
|
| 74 | 'text' => '{from.username} replied to <a href="{url}">your post</a>', |
|
| 75 | ], |
|
| 76 | 'from' => [ |
|
| 77 | 'username' => 'jhon', |
|
| 78 | ], |
|
| 79 | 'extra' => null, |
|
| 80 | ]; |
|
| 81 | ||
| 82 | $this->parse($notification)->shouldReturn('jhon replied to <a href="http://localhost">your post</a>'); |
|
| 83 | } |
|
| 84 | ||
| 85 | /** @test */ |
|
| 86 | public function it_will_remove_extra_markup_if_extra_value_is_not_provided() |
|