options = array( 'daemon_collector_key' => 'RC-XXXXXXXXXX-X' ); $this->daemonCollector = WC_Retailcrm_Daemon_Collector::getInstance($this->options); } public function test_initialize_daemon_collector() { $customerObject = WC_Helper_Customer::create_customer(); WC()->customer = $customerObject; $js = $this->daemonCollector->initialize_daemon_collector(); $this->assertContains('customerId', $js); $this->assertContains($this->options['daemon_collector_key'], $js); $this->assertContains('assertContains('', $js); $this->assertContains('_rc(\'create\',', $js); } }