REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.29 KB
Close
/home/nshryvcy/radiantskinclinics.org/wp-content/plugins/woocommerce/src/Internal/CostOfGoodsSold/CogsAwareUnitTestSuiteTrait.php
Text
Base64
<?php declare( strict_types=1 ); namespace Automattic\WooCommerce\Internal\CostOfGoodsSold; /** * Trait with common functionality for unit tests related to the Cost of Goods Sold feature. */ trait CogsAwareUnitTestSuiteTrait { /** * Enable the Cost of Goods Sold feature. */ private function enable_cogs_feature() { update_option( 'woocommerce_feature_cost_of_goods_sold_enabled', 'yes' ); } /** * Enable the Cost of Goods Sold feature. */ private function disable_cogs_feature() { delete_option( 'woocommerce_feature_cost_of_goods_sold_enabled' ); } /** * Sets the expectation for a "doing it wrong" being thrown. * * @param string $method_name The method name inside the error message. */ private function expect_doing_it_wrong_cogs_disabled( string $method_name ) { $this->register_legacy_proxy_function_mocks( array( 'wc_doing_it_wrong' => function ( $function_name, $message ) { // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped throw new \Exception( "Doing it wrong, function: '$function_name', message: '$message'" ); }, ) ); $this->expectExceptionMessage( "Doing it wrong, function: '{$method_name}', message: 'The Cost of Goods sold feature is disabled, thus the method called will do nothing and will return dummy data.'" ); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
CogsAwareRestControllerTrait.php
4.31 KB
lrw-r--r--
2025-01-21 18:53:44
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CogsAwareTrait.php
1.06 KB
lrw-r--r--
2024-12-16 15:24:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CogsAwareUnitTestSuiteTrait.php
1.29 KB
lrw-r--r--
2024-11-14 01:17:00
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CostOfGoodsSoldController.php
5.86 KB
lrw-r--r--
2025-10-06 17:56:06
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).