| @@ -114,8 +114,9 @@ | ||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
| 117 | 117 | * Add custom NGG mixin to override its functions. |
| 118 | + * No-op on NGG v4.x where the POPE framework (Mixin / C_Gallery_Storage) is absent. | |
| 118 | 119 | * |
| 119 | 120 | * @since 1.5 |
| 120 | 121 | * @access public |
| 121 | 122 | * @author Jonathan Buttigieg |
| @@ -120,7 +121,13 @@ | ||
| 120 | 121 | * @access public |
| 121 | 122 | * @author Jonathan Buttigieg |
| 122 | 123 | */ |
| 123 | 124 | public function add_mixin() { |
| 125 | + // @codeCoverageIgnoreStart — requires live NGG v3 POPE classes, not available in unit tests. | |
| 126 | + if ( ! imagify_ngg_has_pope_storage() ) { | |
| 127 | + return; | |
| 128 | + } | |
| 129 | + | |
| 124 | 130 | \C_Gallery_Storage::get_instance()->get_wrapped_instance()->add_mixin( '\\Imagify\\ThirdParty\\NGG\\NGGStorage' ); |
| 131 | + // @codeCoverageIgnoreEnd | |
| 125 | 132 | } |
| 126 | 133 | } |