View more context

 

kinglozzer

@Mo Anonymous classes seem to work, albeit not via add_extension(), just tested in a page controller:

  1. $page = $this->data();
  2. $page->extension_instances[] = new Class extends Extension {
  3. public function extensionTest() {
  4. die('hello');
  5. }
  6. };
  7. $page->extend('extensionTest');

Mo

@kinglozzer I am getting Indirect modification of overloaded property SilverCommerce\TaxAdmin\Tests\Model\TestProduct::$extension_instances has no effect

kinglozzer

That’s weird… I don’t know what might be overloading it 😬

Mo

Ah, the event hook itself is added by an extension, that might cause issues

Mo

Basically I want to test this extension hook: https://github.com/silvercommerce/tax-admin/blob/1.0/src/extensions/PricingExtension.php#L191

Show 1 attachment(s)
GitHub  
silvercommerce/tax-admin

Adds generic admin for managing tax rates via siteconfig - silvercommerce/tax-admin

Hide attachment content