fix(2meet-data-optimizer-hivepress-addon): map marketplace hot field to hp_price
- hivepress-marketplace stores its filterable, sortable listing price as hp_price; hp_purchase_price never existed (dev34: 588 hp_price rows) - Drop hp_purchase_count: the addon keeps no per-listing sales counter - Remove the stale docblock note about the legacy core registration path Verify: vendor/bin/phpunit --filter test_on_register_fields_registers_hot_hp_price; addon unit 156 OK, integration 57 OK PR: PR-011
This commit is contained in:
@@ -33,17 +33,19 @@ class HivePressMarketplaceAdapterTest extends TestCase {
|
||||
$this->assertSame( 'HivePress\\Marketplace\\Plugin', $this->adapter->detection_class() );
|
||||
}
|
||||
|
||||
public function test_on_register_fields_registers_hot_price_and_warm_counter(): void {
|
||||
public function test_on_register_fields_registers_hot_hp_price(): void {
|
||||
$registry = WPDO_Schema_Registry::instance();
|
||||
$this->adapter->on_register_fields( $registry );
|
||||
|
||||
$price = $registry->get_field( 'hp_listing', 'hp_purchase_price' );
|
||||
// Marketplace's filterable, sortable listing "price" attribute is stored as hp_price.
|
||||
$price = $registry->get_field( 'hp_listing', 'hp_price' );
|
||||
$this->assertSame( 'hot', $price['zone'] );
|
||||
$this->assertTrue( (bool) $price['indexed'] );
|
||||
$this->assertStringContainsString( 'decimal', $price['data_type'] );
|
||||
|
||||
$count = $registry->get_field( 'hp_listing', 'hp_purchase_count' );
|
||||
$this->assertSame( 'warm', $count['zone'] );
|
||||
// Neither key exists in hivepress-marketplace.
|
||||
$this->assertNull( $registry->get_field( 'hp_listing', 'hp_purchase_price' ) );
|
||||
$this->assertNull( $registry->get_field( 'hp_listing', 'hp_purchase_count' ) );
|
||||
}
|
||||
|
||||
public function test_score_aggregates_to_nine_eight_eight(): void {
|
||||
|
||||
Reference in New Issue
Block a user