Passed
Push — master ( 4d5a2c...e5e596 )
by Stephan
02:04 queued 11s
created

EntityTest::testMailBoxEntity()   A

Complexity

Conditions 1
Paths 1

Size

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