1
0
mirror of synced 2025-01-19 09:21:43 +03:00
woocommerce-module/tests/test-wc-retailcrm-icml.php

37 lines
891 B
PHP
Raw Normal View History

2020-04-05 10:36:45 +03:00
<?php
class WC_Retailcrm_Icml_Test extends WC_Retailcrm_Test_Case_Helper
{
public function setUp()
{
for ($i = 0; $i < 10; $i++) {
WC_Helper_Product::create_simple_product();
}
2020-04-05 12:13:09 +03:00
wp_insert_term(
'Test', // the term
'product_cat', // the taxonomy
array(
'description'=> 'Test',
'slug' => 'test'
)
);
2020-04-05 10:36:45 +03:00
}
public function testGenerate()
{
$icml = new WC_Retailcrm_Icml();
$icml->generate();
2021-06-30 13:06:18 +03:00
$this->assertFileExists(ABSPATH . 'simla.xml');
$xml = simplexml_load_file(ABSPATH . 'simla.xml');
2020-04-05 10:36:45 +03:00
$res = $xml->xpath('/yml_catalog/shop/categories/category[@id]');
$this->assertNotEmpty($res);
foreach ($res as $node) {
$this->assertEquals('category', $node->getName());
}
}
}