Completed
Pull Request — master (#351)
by
unknown
03:37 queued 27s
created

EntityTest::testRevenueListEntity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 2
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
use PHPUnit\Framework\TestCase;
4
use Picqer\Financials\Exact\Connection;
5
6
/**
7
 * Class EntityTest.
8
 *
9
 * Tests all entities to ensure entities have no PHP parse errors and have
10
 * at least the properties we need to use the entity
11
 */
12
class EntityTest extends TestCase
13
{
14
    public function testAccountEntity()
15
    {
16
        $this->performEntityTest(\Picqer\Financials\Exact\Account::class);
17
    }
18
19
    public function testAccountClassificationEntity()
20
    {
21
        $this->performEntityTest(\Picqer\Financials\Exact\AccountClassification::class);
22
    }
23
24
    public function testAccountInvolvedAccountEntity()
25
    {
26
        $this->performEntityTest(\Picqer\Financials\Exact\AccountInvolvedAccount::class);
27
    }
28
29
    public function testAccountItemEntity()
30
    {
31
        $this->performEntityTest(\Picqer\Financials\Exact\AccountItem::class);
32
    }
33
34
    public function testAddressEntity()
35
    {
36
        $this->performEntityTest(\Picqer\Financials\Exact\Address::class);
37
    }
38
39
    public function testBankAccountEntity()
40
    {
41
        $this->performEntityTest(\Picqer\Financials\Exact\BankAccount::class);
42
    }
43
44
    public function testBankEntity()
45
    {
46
        $this->performEntityTest(\Picqer\Financials\Exact\Bank::class);
47
    }
48
49
    public function testBankEntryEntity()
50
    {
51
        $this->performEntityTest(\Picqer\Financials\Exact\BankEntry::class);
52
    }
53
54
    public function testBankEntryLineEntity()
55
    {
56
        $this->performEntityTest(\Picqer\Financials\Exact\BankEntryLine::class);
57
    }
58
59
    public function testBudgetEntity()
60
    {
61
        $this->performEntityTest(\Picqer\Financials\Exact\Budget::class);
62
    }
63
64
    public function testCashEntryEntity()
65
    {
66
        $this->performEntityTest(\Picqer\Financials\Exact\CashEntry::class);
67
    }
68
69
    public function testCashEntryLineEntity()
70
    {
71
        $this->performEntityTest(\Picqer\Financials\Exact\CashEntryLine::class);
72
    }
73
74
    public function testContactEntity()
75
    {
76
        $this->performEntityTest(\Picqer\Financials\Exact\Contact::class);
77
    }
78
79
    public function testCostcenterEntity()
80
    {
81
        $this->performEntityTest(\Picqer\Financials\Exact\Costcenter::class);
82
    }
83
84
    public function testCostunitEntity()
85
    {
86
        $this->performEntityTest(\Picqer\Financials\Exact\Costunit::class);
87
    }
88
89
    public function testDirectDebitMandateEntity()
90
    {
91
        $this->performEntityTest(\Picqer\Financials\Exact\DirectDebitMandate::class);
92
    }
93
94
    public function testDivisionEntity()
95
    {
96
        $this->performEntityTest(\Picqer\Financials\Exact\Division::class);
97
    }
98
99
    public function testSystemDivisionEntity()
100
    {
101
        $this->performEntityTest(\Picqer\Financials\Exact\SystemDivision::class);
102
    }
103
104
    public function testDocumentEntity()
105
    {
106
        $this->performEntityTest(\Picqer\Financials\Exact\Document::class);
107
    }
108
109
    public function testDocumentAttachmentEntity()
110
    {
111
        $this->performEntityTest(\Picqer\Financials\Exact\DocumentAttachment::class);
112
        $documentAttachment = new \Picqer\Financials\Exact\DocumentAttachment(new Connection());
113
        $documentAttachment->Url = 'http://www.example.org/index.html?id=123';
114
115
        $this->assertSame('http://www.example.org/index.html?id=123&Download=1', $documentAttachment->getDownloadUrl());
116
    }
117
118
    public function testDocumentCategoryEntity()
119
    {
120
        $this->performEntityTest(\Picqer\Financials\Exact\DocumentCategory::class);
121
    }
122
123
    public function testDocumentTypeEntity()
124
    {
125
        $this->performEntityTest(\Picqer\Financials\Exact\DocumentType::class);
126
    }
127
128
    public function testEmployeeEntity()
129
    {
130
        $this->performEntityTest(\Picqer\Financials\Exact\Employee::class);
131
    }
132
133
    public function testExchangeRateEntity()
134
    {
135
        $this->performEntityTest(\Picqer\Financials\Exact\ExchangeRate::class);
136
    }
137
138
    public function testGeneralJournalEntity()
139
    {
140
        $this->performEntityTest(\Picqer\Financials\Exact\GeneralJournalEntry::class);
141
    }
142
143
    public function testGeneralJournalEntryLineEntity()
144
    {
145
        $this->performEntityTest(\Picqer\Financials\Exact\GeneralJournalEntryLine::class);
146
    }
147
148
    public function testGLAccountEntity()
149
    {
150
        $this->performEntityTest(\Picqer\Financials\Exact\GLAccount::class);
151
    }
152
153
    public function testGLTransactionTypeEntity()
154
    {
155
        $this->performEntityTest(\Picqer\Financials\Exact\GLTransactionType::class);
156
    }
157
158
    public function testInvoiceSalesOrdersEntity()
159
    {
160
        $this->performEntityTest(\Picqer\Financials\Exact\InvoiceSalesOrder::class);
161
    }
162
163
    public function testItemEntity()
164
    {
165
        $this->performEntityTest(\Picqer\Financials\Exact\Item::class);
166
        $item = new \Picqer\Financials\Exact\Item(new Connection());
167
        $item->PictureUrl = 'http://www.example.org/index.html?id=123';
168
169
        $this->assertSame('http://www.example.org/index.html?id=123', $item->getDownloadUrl());
170
    }
171
172
    public function testItemExtraField()
173
    {
174
        $this->performEntityTest(\Picqer\Financials\Exact\ItemExtraField::class);
175
    }
176
177
    public function testItemGroupEntity()
178
    {
179
        $this->performEntityTest(\Picqer\Financials\Exact\ItemGroup::class);
180
    }
181
182
    public function testItemWarehouseEntity()
183
    {
184
        $this->performEntityTest(\Picqer\Financials\Exact\ItemWarehouse::class);
185
    }
186
187
    public function testJournalEntity()
188
    {
189
        $this->performEntityTest(\Picqer\Financials\Exact\Journal::class);
190
    }
191
192
    public function testLayoutEntity()
193
    {
194
        $this->performEntityTest(\Picqer\Financials\Exact\Layout::class);
195
    }
196
197
    public function testMailMessageEntity()
198
    {
199
        $this->performEntityTest(\Picqer\Financials\Exact\MailMessage::class);
200
    }
201
202
    public function testMailMessageAttachmentEntity()
203
    {
204
        $this->performEntityTest(\Picqer\Financials\Exact\MailMessageAttachment::class);
205
    }
206
207
    public function testMeEntity()
208
    {
209
        $this->performEntityTest(\Picqer\Financials\Exact\Me::class);
210
    }
211
212
    public function testOutstandingInvoicesOverviewEntity()
213
    {
214
        $this->performEntityTest(\Picqer\Financials\Exact\OutstandingInvoicesOverview::class);
215
    }
216
217
    public function testPayablesListEntity()
218
    {
219
        $this->performEntityTest(\Picqer\Financials\Exact\PayablesList::class);
220
    }
221
222
    public function testPaymentConditionEntity()
223
    {
224
        $this->performEntityTest(\Picqer\Financials\Exact\PaymentCondition::class);
225
    }
226
227
    public function testPrintedSalesInvoiceEntity()
228
    {
229
        $this->performEntityTest(\Picqer\Financials\Exact\PrintedSalesInvoice::class);
230
    }
231
232
    public function testProfitLossOverviewEntity()
233
    {
234
        $this->performEntityTest(\Picqer\Financials\Exact\ProfitLossOverview::class);
235
    }
236
237
    public function testPurchaseEntryEntity()
238
    {
239
        $this->performEntityTest(\Picqer\Financials\Exact\PurchaseEntry::class);
240
    }
241
242
    public function testPurchaseEntryLineEntity()
243
    {
244
        $this->performEntityTest(\Picqer\Financials\Exact\PurchaseEntryLine::class);
245
    }
246
247
    public function testPurchaseOrderEntity()
248
    {
249
        $this->performEntityTest(\Picqer\Financials\Exact\PurchaseOrder::class);
250
    }
251
252
    public function testPurchaseOrderLineEntity()
253
    {
254
        $this->performEntityTest(\Picqer\Financials\Exact\PurchaseOrderLine::class);
255
    }
256
257
    public function testRevenueListEntity(){
258
        $this->performEntityTest(\Picqer\Financials\Exact\RevenueList::class);
259
    }
260
261
    public function testQuotationEntity()
262
    {
263
        $this->performEntityTest(\Picqer\Financials\Exact\Quotation::class);
264
    }
265
266
    public function testQuotationLineEntity()
267
    {
268
        $this->performEntityTest(\Picqer\Financials\Exact\QuotationLine::class);
269
    }
270
271
    public function testReceivableListEntity()
272
    {
273
        $this->performEntityTest(\Picqer\Financials\Exact\ReceivableList::class);
274
    }
275
276
    public function testReportingBalanceEntity()
277
    {
278
        $this->performEntityTest(\Picqer\Financials\Exact\ReportingBalance::class);
279
    }
280
281
    public function testSalesEntryEntity()
282
    {
283
        $this->performEntityTest(\Picqer\Financials\Exact\SalesEntry::class);
284
    }
285
286
    public function testSalesEntryLineEntity()
287
    {
288
        $this->performEntityTest(\Picqer\Financials\Exact\SalesEntryLine::class);
289
    }
290
291
    public function testSalesInvoiceEntity()
292
    {
293
        $this->performEntityTest(\Picqer\Financials\Exact\SalesInvoice::class);
294
    }
295
296
    public function testSalesInvoiceLineEntity()
297
    {
298
        $this->performEntityTest(\Picqer\Financials\Exact\SalesInvoiceLine::class);
299
    }
300
301
    public function testSalesItemPriceEntity()
302
    {
303
        $this->performEntityTest(\Picqer\Financials\Exact\SalesItemPrice::class);
304
    }
305
306
    public function testSalesOrderEntity()
307
    {
308
        $this->performEntityTest(\Picqer\Financials\Exact\SalesOrder::class);
309
    }
310
311
    public function testSalesOrderLineEntity()
312
    {
313
        $this->performEntityTest(\Picqer\Financials\Exact\SalesOrderLine::class);
314
    }
315
316
    public function testStockPositionEntity()
317
    {
318
        $this->performEntityTest(\Picqer\Financials\Exact\StockPosition::class);
319
    }
320
321
    public function testSubscriptionEntity()
322
    {
323
        $this->performEntityTest(\Picqer\Financials\Exact\Subscription::class);
324
    }
325
326
    public function testSubscriptionLineEntity()
327
    {
328
        $this->performEntityTest(\Picqer\Financials\Exact\SubscriptionLine::class);
329
    }
330
331
    public function testSubscriptionTypeEntity()
332
    {
333
        $this->performEntityTest(\Picqer\Financials\Exact\SubscriptionType::class);
334
    }
335
336
    public function testTransactionEntity()
337
    {
338
        $this->performEntityTest(\Picqer\Financials\Exact\Transaction::class);
339
    }
340
341
    public function testTransactionLineEntity()
342
    {
343
        $this->performEntityTest(\Picqer\Financials\Exact\TransactionLine::class);
344
    }
345
346
    public function testUnitsEntity()
347
    {
348
        $this->performEntityTest(\Picqer\Financials\Exact\Units::class);
349
    }
350
351
    public function testVatcodeEntity()
352
    {
353
        $this->performEntityTest(\Picqer\Financials\Exact\VatCode::class);
354
    }
355
356
    public function testWebhookSubscriptionEntity()
357
    {
358
        $this->performEntityTest(\Picqer\Financials\Exact\WebhookSubscription::class);
359
    }
360
361
    public function testStockCountEntity()
362
    {
363
        $this->performEntityTest(\Picqer\Financials\Exact\StockCount::class);
364
    }
365
366
    public function testStockCountLineEntity()
367
    {
368
        $this->performEntityTest(\Picqer\Financials\Exact\StockCountLine::class);
369
    }
370
371
    public function testWarehouseEntity()
372
    {
373
        $this->performEntityTest(\Picqer\Financials\Exact\Warehouse::class);
374
    }
375
376
    public function testStorageLocationEntity()
377
    {
378
        $this->performEntityTest(\Picqer\Financials\Exact\StorageLocation::class);
379
    }
380
381
    public function testGoodsDeliveryEntity()
382
    {
383
        $this->performEntityTest(\Picqer\Financials\Exact\GoodsDelivery::class);
384
    }
385
386
    public function testGoodsDeliveryLineEntity()
387
    {
388
        $this->performEntityTest(\Picqer\Financials\Exact\GoodsDeliveryLine::class);
389
    }
390
391
    public function testSalesOrderIDEntity()
392
    {
393
        $this->performEntityTest(\Picqer\Financials\Exact\SalesOrderID::class);
394
    }
395
396
    public function testItemWarehousePlanningDetails()
397
    {
398
        $this->performEntityTest(\Picqer\Financials\Exact\ItemWarehousePlanningDetails::class);
399
    }
400
401
    public function testSalesShippingMethods()
402
    {
403
        $this->performEntityTest(\Picqer\Financials\Exact\SalesShippingMethods::class);
404
    }
405
406
    public function testInvoiceTerm()
407
    {
408
        $this->performEntityTest(\Picqer\Financials\Exact\InvoiceTerm::class);
409
    }
410
411
    public function testBillOfMaterialVersion()
412
    {
413
        $this->performEntityTest(\Picqer\Financials\Exact\BillOfMaterialVersion::class);
414
    }
415
416
    public function testBillOfMaterialMaterial()
417
    {
418
        $this->performEntityTest(\Picqer\Financials\Exact\BillOfMaterialMaterial::class);
419
    }
420
421
    public function testProject()
422
    {
423
        $this->performEntityTest(\Picqer\Financials\Exact\Project::class);
424
    }
425
426
    public function testProjectWBSByProject()
427
    {
428
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectWBSByProject::class);
429
    }
430
431
    public function testShopOrder()
432
    {
433
        $this->performEntityTest(\Picqer\Financials\Exact\ShopOrder::class);
434
    }
435
436
    public function testTimeTransactionEntity()
437
    {
438
        $this->performEntityTest(\Picqer\Financials\Exact\TimeTransaction::class);
439
    }
440
441
    public function testUser()
442
    {
443
        $this->performEntityTest(\Picqer\Financials\Exact\User::class);
444
    }
445
446
    public function testShopOrderMaterialPlan()
447
    {
448
        $this->performEntityTest(\Picqer\Financials\Exact\ShopOrderMaterialPlan::class);
449
    }
450
451
    public function testShopOrderRoutingStepPlan()
452
    {
453
        $this->performEntityTest(\Picqer\Financials\Exact\ShopOrderRoutingStepPlan::class);
454
    }
455
456
    public function testOperation()
457
    {
458
        $this->performEntityTest(\Picqer\Financials\Exact\Operation::class);
459
    }
460
461
    public function testOperationResource()
462
    {
463
        $this->performEntityTest(\Picqer\Financials\Exact\OperationResource::class);
464
    }
465
466
    public function testAbsenceRegistration()
467
    {
468
        $this->performEntityTest(\Picqer\Financials\Exact\AbsenceRegistration::class);
469
    }
470
471
    public function testAbsenceRegistrationTransaction()
472
    {
473
        $this->performEntityTest(\Picqer\Financials\Exact\AbsenceRegistrationTransaction::class);
474
    }
475
476
    public function testDepartment()
477
    {
478
        $this->performEntityTest(\Picqer\Financials\Exact\Department::class);
479
    }
480
481
    public function testDivisionClass()
482
    {
483
        $this->performEntityTest(\Picqer\Financials\Exact\DivisionClass::class);
484
    }
485
486
    public function testDivisionClassName()
487
    {
488
        $this->performEntityTest(\Picqer\Financials\Exact\DivisionClassName::class);
489
    }
490
491
    public function testDivisionClassValue()
492
    {
493
        $this->performEntityTest(\Picqer\Financials\Exact\DivisionClassValue::class);
494
    }
495
496
    public function testJobGroup()
497
    {
498
        $this->performEntityTest(\Picqer\Financials\Exact\JobGroup::class);
499
    }
500
501
    public function testJobTitle()
502
    {
503
        $this->performEntityTest(\Picqer\Financials\Exact\JobTitle::class);
504
    }
505
506
    public function testLeaveBuildUpRegistration()
507
    {
508
        $this->performEntityTest(\Picqer\Financials\Exact\LeaveBuildUpRegistration::class);
509
    }
510
511
    public function testLeaveRegistration()
512
    {
513
        $this->performEntityTest(\Picqer\Financials\Exact\LeaveRegistration::class);
514
    }
515
516
    public function testSchedule()
517
    {
518
        $this->performEntityTest(\Picqer\Financials\Exact\Schedule::class);
519
    }
520
521
    public function testStockBatchNumber()
522
    {
523
        $this->performEntityTest(\Picqer\Financials\Exact\StockBatchNumber::class);
524
    }
525
526
    public function testStockSerialNumber()
527
    {
528
        $this->performEntityTest(\Picqer\Financials\Exact\StockSerialNumber::class);
529
    }
530
531
    public function testWarehouseTransferLine()
532
    {
533
        $this->performEntityTest(\Picqer\Financials\Exact\WarehouseTransferLine::class);
534
    }
535
536
    public function testWarehouseTransfer()
537
    {
538
        $this->performEntityTest(\Picqer\Financials\Exact\WarehouseTransfer::class);
539
    }
540
541
    public function testProductionArea()
542
    {
543
        $this->performEntityTest(\Picqer\Financials\Exact\ProductionArea::class);
544
    }
545
546
    public function testTimedTimeTransaction()
547
    {
548
        $this->performEntityTest(\Picqer\Financials\Exact\TimedTimeTransaction::class);
549
    }
550
551
    public function testWorkcenter()
552
    {
553
        $this->performEntityTest(\Picqer\Financials\Exact\Workcenter::class);
554
    }
555
556
    public function testCostTransaction()
557
    {
558
        $this->performEntityTest(\Picqer\Financials\Exact\CostTransaction::class);
559
    }
560
561
    public function testProjectHourBudget()
562
    {
563
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectHourBudget::class);
564
    }
565
566
    public function testProjectPlanning()
567
    {
568
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectPlanning::class);
569
    }
570
571
    public function testProjectPlanningRecurring()
572
    {
573
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectPlanningRecurring::class);
574
    }
575
576
    public function testProjectRestrictionEmployee()
577
    {
578
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectRestrictionEmployee::class);
579
    }
580
581
    public function testProjectRestrictionItem()
582
    {
583
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectRestrictionItem::class);
584
    }
585
586
    public function testProjectRestrictionRebilling()
587
    {
588
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectRestrictionRebilling::class);
589
    }
590
591
    public function testRecentCost()
592
    {
593
        $this->performEntityTest(\Picqer\Financials\Exact\RecentCost::class);
594
    }
595
596
    public function testRecentHour()
597
    {
598
        $this->performEntityTest(\Picqer\Financials\Exact\RecentHour::class);
599
    }
600
601
    public function testTimeCorrection()
602
    {
603
        $this->performEntityTest(\Picqer\Financials\Exact\TimeCorrection::class);
604
    }
605
606
    public function testEmployment()
607
    {
608
        $this->performEntityTest(\Picqer\Financials\Exact\Employment::class);
609
    }
610
611
    public function testEmploymentContract()
612
    {
613
        $this->performEntityTest(\Picqer\Financials\Exact\EmploymentContract::class);
614
    }
615
616
    public function testActiveEmployment()
617
    {
618
        $this->performEntityTest(\Picqer\Financials\Exact\ActiveEmployment::class);
619
    }
620
621
    protected function performEntityTest($entityName)
622
    {
623
        $reflectionClass = new ReflectionClass($entityName);
624
625
        $this->assertTrue($reflectionClass->isInstantiable());
626
        $this->assertTrue($reflectionClass->hasProperty('fillable'));
627
        $this->assertTrue($reflectionClass->hasProperty('url'));
628
        $this->assertEquals('Picqer\Financials\Exact', $reflectionClass->getNamespaceName());
629
        $this->assertEquals('Picqer\Financials\Exact\Model', $reflectionClass->getParentClass()->getName());
630
    }
631
}
632