Revision 98aa76be
Von Werner Hahn vor mehr als 7 Jahren hinzugefügt
t/shop/shop_order.t | ||
---|---|---|
6 | 6 |
use Carp; |
7 | 7 |
use Test::Exception; |
8 | 8 |
use SL::Dev::ALL; |
9 |
use SL::Dev::Part qw(new_part); |
|
10 |
use SL::Dev::Shop qw(new_shop new_shop_part new_shop_order); |
|
11 |
use SL::Dev::CustomerVendor qw(new_customer); |
|
9 | 12 |
use SL::DB::Shop; |
10 | 13 |
use SL::DB::ShopOrder; |
11 | 14 |
use SL::DB::ShopOrderItem; |
... | ... | |
19 | 22 |
|
20 | 23 |
clear_up(); |
21 | 24 |
|
22 |
$shop = SL::Dev::Shop::new_shop->save;
|
|
23 |
$part = SL::Dev::Part::new_part->save;
|
|
24 |
$shop_part = SL::Dev::Shop::new_shop_part(part => $part, shop => $shop)->save;
|
|
25 |
$shop = new_shop->save; |
|
26 |
$part = new_part->save; |
|
27 |
$shop_part = new_shop_part(part => $part, shop => $shop)->save; |
|
25 | 28 |
|
26 | 29 |
$employee = SL::DB::Manager::Employee->current || croak "No employee"; |
27 | 30 |
|
28 |
$customer = SL::Dev::CustomerVendor::new_customer( |
|
29 |
name => 'Evil Inc', |
|
30 |
street => 'Evil Street', |
|
31 |
zipcode => '66666', |
|
32 |
email => 'evil@evilinc.com' |
|
33 |
)->save; |
|
31 |
$customer = new_customer( name => 'Evil Inc', |
|
32 |
street => 'Evil Street', |
|
33 |
zipcode => '66666', |
|
34 |
email => 'evil@evilinc.com' |
|
35 |
)->save; |
|
34 | 36 |
} |
35 | 37 |
|
36 | 38 |
sub save_shorcontroller_to_string { |
... | ... | |
67 | 69 |
|
68 | 70 |
my $shop_trans_id = 1; |
69 | 71 |
|
70 |
$shop_order = SL::Dev::Shop::new_shop_order(
|
|
72 |
$shop_order = new_shop_order( |
|
71 | 73 |
shop => $shop, |
72 | 74 |
shop_trans_id => $shop_trans_id, |
73 | 75 |
amount => 59.5, |
... | ... | |
96 | 98 |
is($fuzzy_customers->[0]->name, 'Evil Inc', 'matched customer Evil Inc'); |
97 | 99 |
|
98 | 100 |
note('adding a not-so-similar customer'); |
99 |
my $customer_different = SL::Dev::CustomerVendor::new_customer(
|
|
101 |
my $customer_different = new_customer( |
|
100 | 102 |
name => "Different Name", |
101 | 103 |
street => 'Good Straet', # difference large enough from "Evil Street" |
102 | 104 |
zipcode => $customer->zipcode, |
... | ... | |
106 | 108 |
is(scalar @{ $fuzzy_customers }, 1, 'still only found 1 matching customer (zipcode equal + street dissimilar'); |
107 | 109 |
|
108 | 110 |
note('adding a similar customer'); |
109 |
my $customer_similar = SL::Dev::CustomerVendor::new_customer(
|
|
111 |
my $customer_similar = new_customer( |
|
110 | 112 |
name => "Different Name", |
111 | 113 |
street => 'Good Street', # difference not large enough from "Evil Street", street matches |
112 | 114 |
zipcode => $customer->zipcode, |
t/shop/shopware.t | ||
---|---|---|
6 | 6 |
use Carp; |
7 | 7 |
use Test::Exception; |
8 | 8 |
use SL::Dev::ALL; |
9 |
use SL::Dev::Part qw(new_part); |
|
10 |
use SL::Dev::Shop qw(new_shop new_shop_part); |
|
11 |
use SL::Dev::CustomerVendor qw(new_customer); |
|
9 | 12 |
use SL::DB::Shop; |
10 | 13 |
use SL::DB::ShopOrder; |
11 | 14 |
use SL::DB::ShopOrderItem; |
... | ... | |
21 | 24 |
|
22 | 25 |
clear_up(); |
23 | 26 |
|
24 |
$shop = SL::Dev::Shop::new_shop( connector => 'shopware',
|
|
25 |
last_order_number => 20000,
|
|
26 |
pricetype => 'brutto',
|
|
27 |
price_source => 'master_data',
|
|
28 |
taxzone_id => 1,
|
|
29 |
);
|
|
27 |
$shop = new_shop( connector => 'shopware', |
|
28 |
last_order_number => 20000, |
|
29 |
pricetype => 'brutto', |
|
30 |
price_source => 'master_data', |
|
31 |
taxzone_id => 1, |
|
32 |
); |
|
30 | 33 |
$shopware = SL::Shop->new( config => $shop ); |
31 |
$part = SL::Dev::Part::new_part( partnumber => 'SW10002',
|
|
32 |
description => 'TITANIUM CARBON GS 12m cm',
|
|
33 |
);
|
|
34 |
$shop_part = SL::Dev::Shop::new_shop_part(part => $part, shop => $shop);
|
|
34 |
$part = new_part( partnumber => 'SW10002', |
|
35 |
description => 'TITANIUM CARBON GS 12m cm', |
|
36 |
); |
|
37 |
$shop_part = new_shop_part(part => $part, shop => $shop); |
|
35 | 38 |
|
36 | 39 |
$employee = SL::DB::Manager::Employee->current || croak "No employee"; |
37 | 40 |
|
38 |
$customer = SL::Dev::CustomerVendor::new_customer( |
|
39 |
name => 'Evil Inc', |
|
40 |
street => 'Evil Street', |
|
41 |
zipcode => '66666', |
|
42 |
email => 'evil@evilinc.com' |
|
43 |
)->save; |
|
44 |
|
|
41 |
$customer = new_customer( name => 'Evil Inc', |
|
42 |
street => 'Evil Street', |
|
43 |
zipcode => '66666', |
|
44 |
email => 'evil@evilinc.com' |
|
45 |
)->save; |
|
45 | 46 |
} |
46 | 47 |
|
47 | 48 |
sub get_json { |
Auch abrufbar als: Unified diff
WebshopApi: Syntax in Tests