13
13
**/
14
14
15
15
use Illuminate \Support \Facades \App ;
16
+ use LaravelDoctrine \ORM \Facades \EntityManager ;
16
17
use models \summit \PaymentGatewayProfileFactory ;
17
18
use models \summit \IPaymentConstants ;
18
19
use App \Models \Foundation \Summit \Factories \SummitTicketTypeFactory ;
19
20
use App \Models \Foundation \Summit \Factories \SummitBadgeTypeFactory ;
21
+ use models \summit \Summit ;
20
22
use services \model \ISummitService ;
21
23
22
24
/**
@@ -58,54 +60,54 @@ final class OAuth2SummitOrdersApiTest extends ProtectedApiTest
58
60
59
61
use InsertOrdersTestData;
60
62
61
- protected function setUp ():void
62
- {
63
- parent ::setUp ();
64
- self ::$ test_secret_key = env ('TEST_STRIPE_SECRET_KEY ' );
65
- self ::$ test_public_key = env ('TEST_STRIPE_PUBLISHABLE_KEY ' );
66
- self ::$ live_secret_key = env ('LIVE_STRIPE_SECRET_KEY ' );
67
- self ::$ live_public_key = env ('LIVE_STRIPE_PUBLISHABLE_KEY ' );
68
-
69
- self ::insertSummitTestData ();
70
- self ::InsertOrdersTestData ();
71
- // build payment profile and attach to summit
72
- self ::$ profile = PaymentGatewayProfileFactory::build (IPaymentConstants::ProviderStripe, [
73
- 'application_type ' => IPaymentConstants::ApplicationTypeRegistration,
74
- 'is_test_mode ' => true ,
75
- 'test_publishable_key ' => self ::$ test_public_key ,
76
- 'test_secret_key ' => self ::$ test_secret_key ,
77
- 'is_active ' => false ,
78
- ]);
79
-
80
- // build default badge type
81
-
82
- $ defaultBadge = SummitBadgeTypeFactory::build ([
83
- 'name ' => 'DEFAULT ' ,
84
- 'is_default ' => true ,
85
- ]);
86
-
87
- // build ticket type
88
-
89
- self ::$ ticketType = SummitTicketTypeFactory::build (self ::$ summit , [
90
- 'name ' => 'TICKET_1 ' ,
91
- 'cost ' => 100 ,
92
- 'quantity_2_sell ' => 1000 ,
93
- ]);
94
-
95
- self ::$ summit ->addPaymentProfile (self ::$ profile );
96
- self ::$ summit ->addBadgeType ($ defaultBadge );
97
- self ::$ summit ->addTicketType (self ::$ ticketType );
98
-
99
- self ::$ em ->persist (self ::$ summit );
100
- self ::$ em ->flush ();
101
-
102
- }
103
-
104
- protected function tearDown ():void
105
- {
106
- self ::clearSummitTestData ();
107
- parent ::tearDown ();
108
- }
63
+ // protected function setUp():void
64
+ // {
65
+ // parent::setUp();
66
+ // self::$test_secret_key = env('TEST_STRIPE_SECRET_KEY');
67
+ // self::$test_public_key = env('TEST_STRIPE_PUBLISHABLE_KEY');
68
+ // self::$live_secret_key = env('LIVE_STRIPE_SECRET_KEY');
69
+ // self::$live_public_key = env('LIVE_STRIPE_PUBLISHABLE_KEY');
70
+ //
71
+ // self::insertSummitTestData();
72
+ // self::InsertOrdersTestData();
73
+ // // build payment profile and attach to summit
74
+ // self::$profile = PaymentGatewayProfileFactory::build(IPaymentConstants::ProviderStripe, [
75
+ // 'application_type' => IPaymentConstants::ApplicationTypeRegistration,
76
+ // 'is_test_mode' => true,
77
+ // 'test_publishable_key' => self::$test_public_key,
78
+ // 'test_secret_key' => self::$test_secret_key,
79
+ // 'is_active' => false,
80
+ // ]);
81
+ //
82
+ // // build default badge type
83
+ //
84
+ // $defaultBadge = SummitBadgeTypeFactory::build([
85
+ // 'name' => 'DEFAULT',
86
+ // 'is_default' => true,
87
+ // ]);
88
+ //
89
+ // // build ticket type
90
+ //
91
+ // self::$ticketType = SummitTicketTypeFactory::build(self::$summit, [
92
+ // 'name' => 'TICKET_1',
93
+ // 'cost' => 100,
94
+ // 'quantity_2_sell' => 1000,
95
+ // ]);
96
+ //
97
+ // self::$summit->addPaymentProfile(self::$profile);
98
+ // self::$summit->addBadgeType($defaultBadge);
99
+ // self::$summit->addTicketType(self::$ticketType);
100
+ //
101
+ // self::$em->persist(self::$summit);
102
+ // self::$em->flush();
103
+ //
104
+ // }
105
+ //
106
+ // protected function tearDown():void
107
+ // {
108
+ // self::clearSummitTestData();
109
+ // parent::tearDown();
110
+ // }
109
111
110
112
/**
111
113
* @return mixed
@@ -380,11 +382,14 @@ public function testReserveWithSummit(){
380
382
381
383
$ res = memory_get_peak_usage (true );
382
384
385
+ $ summit_repository = EntityManager::getRepository (Summit::class);
386
+ self ::$ summit = $ summit_repository ->find (3685 );
387
+
383
388
$ summitId = self ::$ summit ->getId ();
384
389
$ companyId = 5 ;
385
390
386
391
$ service = App::make (ISummitService::class);
387
- $ service ->addCompany ($ summitId , $ companyId );
392
+ // $service->addCompany($summitId, $companyId);
388
393
$ company = self ::$ summit ->getRegistrationCompanyById ($ companyId );
389
394
390
395
$ params = [
@@ -398,7 +403,8 @@ public function testReserveWithSummit(){
398
403
"owner_company " => $ company ->getName (),
399
404
"owner_company_id " => $ company ->getId (),
400
405
"tickets " => [
401
- ["type_id " => self ::$ ticketType ->getId ()],
406
+ //["type_id" => self::$ticketType->getId()],
407
+ ["type_id " => 3080 ],
402
408
]
403
409
];
404
410
0 commit comments