|
86 | 86 |
|
87 | 87 | $compiled = $this->compile($directive);
|
88 | 88 |
|
89 |
| - expect($compiled)->toEqual("<?php echo get_field('item')['key']; ?>"); |
| 89 | + expect($compiled)->toEqual("<?php echo get_field('item', null, true)['key']; ?>"); |
90 | 90 | });
|
91 | 91 |
|
92 | 92 | it('compiles correctly with post ID', function () {
|
93 | 93 | $directive = "@field('item', 1)";
|
94 | 94 |
|
95 | 95 | $compiled = $this->compile($directive);
|
96 | 96 |
|
97 |
| - expect($compiled)->toEqual("<?php echo get_field('item', 1); ?>"); |
| 97 | + expect($compiled)->toEqual("<?php echo get_field('item', 1, true); ?>"); |
98 | 98 | });
|
99 | 99 |
|
100 | 100 | it('compiles correctly with key and post ID', function () {
|
101 | 101 | $directive = "@field('item', 'key', 1)";
|
102 | 102 |
|
103 | 103 | $compiled = $this->compile($directive);
|
104 | 104 |
|
105 |
| - expect($compiled)->toEqual("<?php echo get_field('item', 1)['key']; ?>"); |
| 105 | + expect($compiled)->toEqual("<?php echo get_field('item', 1, true)['key']; ?>"); |
| 106 | + }); |
| 107 | + |
| 108 | + it('compiles correctly with post ID and formatting', function () { |
| 109 | + $directive = "@field('item', 1, false)"; |
| 110 | + |
| 111 | + $compiled = $this->compile($directive); |
| 112 | + |
| 113 | + expect($compiled)->toEqual("<?php echo get_field('item', 1, false); ?>"); |
| 114 | + }); |
| 115 | + |
| 116 | + it('compiles correctly with key, post ID and formatting', function () { |
| 117 | + $directive = "@field('item', 'key', 1, false)"; |
| 118 | + |
| 119 | + $compiled = $this->compile($directive); |
| 120 | + |
| 121 | + expect($compiled)->toEqual("<?php echo get_field('item', 1, false)['key']; ?>"); |
106 | 122 | });
|
107 | 123 |
|
108 | 124 | it('compiles correctly with post object', function () {
|
109 | 125 | $directive = "@field('item', \$post->ID)";
|
110 | 126 |
|
111 | 127 | $compiled = $this->compile($directive);
|
112 | 128 |
|
113 |
| - expect($compiled)->toEqual("<?php echo get_field('item', \$post->ID); ?>"); |
| 129 | + expect($compiled)->toEqual("<?php echo get_field('item', \$post->ID, true); ?>"); |
114 | 130 | });
|
115 | 131 |
|
116 | 132 | it('compiles correctly with key and post object', function () {
|
117 | 133 | $directive = "@field('item', 'key', \$post->ID)";
|
118 | 134 |
|
119 | 135 | $compiled = $this->compile($directive);
|
120 | 136 |
|
121 |
| - expect($compiled)->toEqual("<?php echo get_field('item', \$post->ID)['key']; ?>"); |
| 137 | + expect($compiled)->toEqual("<?php echo get_field('item', \$post->ID, true)['key']; ?>"); |
| 138 | + }); |
| 139 | + |
| 140 | + it('compiles correctly with post object and formatting', function () { |
| 141 | + $directive = "@field('item', \$post->ID, false)"; |
| 142 | + |
| 143 | + $compiled = $this->compile($directive); |
| 144 | + |
| 145 | + expect($compiled)->toEqual("<?php echo get_field('item', \$post->ID, false); ?>"); |
| 146 | + }); |
| 147 | + |
| 148 | + it('compiles correctly with key, post object and formatting', function () { |
| 149 | + $directive = "@field('item', 'key', \$post->ID, false)"; |
| 150 | + |
| 151 | + $compiled = $this->compile($directive); |
| 152 | + |
| 153 | + expect($compiled)->toEqual("<?php echo get_field('item', \$post->ID, false)['key']; ?>"); |
122 | 154 | });
|
123 | 155 | });
|
124 | 156 |
|
|
0 commit comments