File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646 "php" : " ^8.3" ,
4747 "moneyphp/money" : " ^3.0 | ^4.0" ,
4848 "hiqdev/php-units" : " dev-master" ,
49- "psr/simple-cache" : " ^1.0" ,
50- "cache/array-adapter" : " ^1.2"
49+ "psr/simple-cache" : " ^2.0 | ^3.0"
5150 },
5251 "require-dev" : {
5352 "php" : " ^8.3" ,
Original file line number Diff line number Diff line change 1111namespace hiqdev \php \billing \tests \behat \bootstrap ;
1212
1313use Behat \Behat \Context \Context ;
14- use Behat \Behat \Tester \Exception \PendingException ;
15- use Cache \Adapter \PHPArray \ArrayCachePool ;
1614use Closure ;
1715use DateTimeImmutable ;
1816use Exception ;
3432use hiqdev \php \billing \tests \support \order \SimpleBilling ;
3533use hiqdev \php \billing \type \Type ;
3634use hiqdev \php \units \Quantity ;
37- use hiqdev \php \ units \ Unit ;
35+ use hiqdev \yii \ compat \ PsrCache ;
3836use Money \Currencies \ISOCurrencies ;
3937use Money \Currency ;
4038use Money \Money ;
4139use Money \Parser \DecimalMoneyParser ;
4240use NumberFormatter ;
4341use PHPUnit \Framework \Assert ;
4442use ReflectionClass ;
43+ use yii \caching \ArrayCache ;
4544
4645/**
4746 * Defines application features from the specific context.
@@ -224,7 +223,8 @@ public function formulaContinues(string $formula): void
224223 protected function getFormulaEngine ()
225224 {
226225 if ($ this ->engine === null ) {
227- $ this ->engine = new FormulaEngine (new ArrayCachePool ());
226+ $ cache = new PsrCache (new ArrayCache ());
227+ $ this ->engine = new FormulaEngine ($ cache );
228228 }
229229
230230 return $ this ->engine ;
Original file line number Diff line number Diff line change 1010
1111namespace hiqdev \php \billing \tests \unit \formula ;
1212
13- use Cache \Adapter \PHPArray \ArrayCachePool ;
1413use DateTimeImmutable ;
1514use hiqdev \php \billing \charge \modifiers \addons \MonthPeriod ;
1615use hiqdev \php \billing \charge \modifiers \addons \Reason ;
1716use hiqdev \php \billing \charge \modifiers \addons \Since ;
1817use hiqdev \php \billing \charge \modifiers \FixedDiscount ;
1918use hiqdev \php \billing \charge \modifiers \Installment ;
2019use hiqdev \php \billing \formula \FormulaEngine ;
20+ use hiqdev \yii \compat \PsrCache ;
2121use PHPUnit \Framework \TestCase ;
22+ use yii \caching \ArrayCache ;
2223
2324/**
2425 * @author Andrii Vasyliev <sol@hiqdev.com>
@@ -32,7 +33,8 @@ class FormulaEngineTest extends TestCase
3233
3334 public function setUp (): void
3435 {
35- $ this ->engine = new FormulaEngine (new ArrayCachePool ());
36+ $ cache = new PsrCache (new ArrayCache ());
37+ $ this ->engine = new FormulaEngine ($ cache );
3638 }
3739
3840 public function testSimpleDiscount ()
You can’t perform that action at this time.
0 commit comments