Completed
Pull Request — master (#408)
by
unknown
02:14
created

EntityTest::testWarehouseTransferLine()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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 testMailMessageEntity()
200
    {
201
        $this->performEntityTest(\Picqer\Financials\Exact\MailMessage::class);
202
    }
203
204
    public function testMailMessageAttachmentEntity()
205
    {
206
        $this->performEntityTest(\Picqer\Financials\Exact\MailMessageAttachment::class);
207
    }
208
209
    public function testMeEntity()
210
    {
211
        $this->performEntityTest(\Picqer\Financials\Exact\Me::class);
212
    }
213
214
    public function testOutstandingInvoicesOverviewEntity()
215
    {
216
        $this->performEntityTest(\Picqer\Financials\Exact\OutstandingInvoicesOverview::class);
217
    }
218
219
    public function testPayablesListEntity()
220
    {
221
        $this->performEntityTest(\Picqer\Financials\Exact\PayablesList::class);
222
    }
223
224
    public function testPaymentConditionEntity()
225
    {
226
        $this->performEntityTest(\Picqer\Financials\Exact\PaymentCondition::class);
227
    }
228
229
    public function testPrintedSalesInvoiceEntity()
230
    {
231
        $this->performEntityTest(\Picqer\Financials\Exact\PrintedSalesInvoice::class);
232
    }
233
234
    public function testProfitLossOverviewEntity()
235
    {
236
        $this->performEntityTest(\Picqer\Financials\Exact\ProfitLossOverview::class);
237
    }
238
239
    public function testPurchaseEntryEntity()
240
    {
241
        $this->performEntityTest(\Picqer\Financials\Exact\PurchaseEntry::class);
242
    }
243
244
    public function testPurchaseEntryLineEntity()
245
    {
246
        $this->performEntityTest(\Picqer\Financials\Exact\PurchaseEntryLine::class);
247
    }
248
249
    public function testPurchaseOrderEntity()
250
    {
251
        $this->performEntityTest(\Picqer\Financials\Exact\PurchaseOrder::class);
252
    }
253
254
    public function testPurchaseOrderLineEntity()
255
    {
256
        $this->performEntityTest(\Picqer\Financials\Exact\PurchaseOrderLine::class);
257
    }
258
259
    public function testRevenueListEntity()
260
    {
261
        $this->performEntityTest(\Picqer\Financials\Exact\RevenueList::class);
262
    }
263
264
    public function testQuotationEntity()
265
    {
266
        $this->performEntityTest(\Picqer\Financials\Exact\Quotation::class);
267
    }
268
269
    public function testQuotationLineEntity()
270
    {
271
        $this->performEntityTest(\Picqer\Financials\Exact\QuotationLine::class);
272
    }
273
274
    public function testReceivableListEntity()
275
    {
276
        $this->performEntityTest(\Picqer\Financials\Exact\ReceivableList::class);
277
    }
278
279
    public function testReportingBalanceEntity()
280
    {
281
        $this->performEntityTest(\Picqer\Financials\Exact\ReportingBalance::class);
282
    }
283
284
    public function testSalesEntryEntity()
285
    {
286
        $this->performEntityTest(\Picqer\Financials\Exact\SalesEntry::class);
287
    }
288
289
    public function testSalesEntryLineEntity()
290
    {
291
        $this->performEntityTest(\Picqer\Financials\Exact\SalesEntryLine::class);
292
    }
293
294
    public function testSalesInvoiceEntity()
295
    {
296
        $this->performEntityTest(\Picqer\Financials\Exact\SalesInvoice::class);
297
    }
298
299
    public function testSalesInvoiceLineEntity()
300
    {
301
        $this->performEntityTest(\Picqer\Financials\Exact\SalesInvoiceLine::class);
302
    }
303
304
    public function testSalesItemPriceEntity()
305
    {
306
        $this->performEntityTest(\Picqer\Financials\Exact\SalesItemPrice::class);
307
    }
308
309
    public function testSalesOrderEntity()
310
    {
311
        $this->performEntityTest(\Picqer\Financials\Exact\SalesOrder::class);
312
    }
313
314
    public function testSalesOrderLineEntity()
315
    {
316
        $this->performEntityTest(\Picqer\Financials\Exact\SalesOrderLine::class);
317
    }
318
319
    public function testStockPositionEntity()
320
    {
321
        $this->performEntityTest(\Picqer\Financials\Exact\StockPosition::class);
322
    }
323
324
    public function testSubscriptionEntity()
325
    {
326
        $this->performEntityTest(\Picqer\Financials\Exact\Subscription::class);
327
    }
328
329
    public function testSubscriptionLineEntity()
330
    {
331
        $this->performEntityTest(\Picqer\Financials\Exact\SubscriptionLine::class);
332
    }
333
334
    public function testSubscriptionTypeEntity()
335
    {
336
        $this->performEntityTest(\Picqer\Financials\Exact\SubscriptionType::class);
337
    }public function testTaskEntity()
338
    {
339
        $this->performEntityTest(\Picqer\Financials\Exact\Task::class);
0 ignored issues
show
Bug introduced by
The type Picqer\Financials\Exact\Task was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
340
    }public function testTransactionEntity()
341
    {
342
        $this->performEntityTest(\Picqer\Financials\Exact\Transaction::class);
343
    }
344
345
    public function testTransactionLineEntity()
346
    {
347
        $this->performEntityTest(\Picqer\Financials\Exact\TransactionLine::class);
348
    }
349
350
    public function testUnitsEntity()
351
    {
352
        $this->performEntityTest(\Picqer\Financials\Exact\Units::class);
353
    }
354
355
    public function testVatcodeEntity()
356
    {
357
        $this->performEntityTest(\Picqer\Financials\Exact\VatCode::class);
358
    }
359
360
    public function testWebhookSubscriptionEntity()
361
    {
362
        $this->performEntityTest(\Picqer\Financials\Exact\WebhookSubscription::class);
363
    }
364
365
    public function testStockCountEntity()
366
    {
367
        $this->performEntityTest(\Picqer\Financials\Exact\StockCount::class);
368
    }
369
370
    public function testStockCountLineEntity()
371
    {
372
        $this->performEntityTest(\Picqer\Financials\Exact\StockCountLine::class);
373
    }
374
375
    public function testWarehouseEntity()
376
    {
377
        $this->performEntityTest(\Picqer\Financials\Exact\Warehouse::class);
378
    }
379
380
    public function testStorageLocationEntity()
381
    {
382
        $this->performEntityTest(\Picqer\Financials\Exact\StorageLocation::class);
383
    }
384
385
    public function testGoodsDeliveryEntity()
386
    {
387
        $this->performEntityTest(\Picqer\Financials\Exact\GoodsDelivery::class);
388
    }
389
390
    public function testGoodsDeliveryLineEntity()
391
    {
392
        $this->performEntityTest(\Picqer\Financials\Exact\GoodsDeliveryLine::class);
393
    }
394
395
    public function testSalesOrderIDEntity()
396
    {
397
        $this->performEntityTest(\Picqer\Financials\Exact\SalesOrderID::class);
398
    }
399
400
    public function testItemWarehousePlanningDetails()
401
    {
402
        $this->performEntityTest(\Picqer\Financials\Exact\ItemWarehousePlanningDetails::class);
403
    }
404
405
    public function testSalesShippingMethods()
406
    {
407
        $this->performEntityTest(\Picqer\Financials\Exact\SalesShippingMethods::class);
408
    }
409
410
    public function testInvoiceTerm()
411
    {
412
        $this->performEntityTest(\Picqer\Financials\Exact\InvoiceTerm::class);
413
    }
414
415
    public function testBillOfMaterialVersion()
416
    {
417
        $this->performEntityTest(\Picqer\Financials\Exact\BillOfMaterialVersion::class);
418
    }
419
420
    public function testBillOfMaterialMaterial()
421
    {
422
        $this->performEntityTest(\Picqer\Financials\Exact\BillOfMaterialMaterial::class);
423
    }
424
425
    public function testProject()
426
    {
427
        $this->performEntityTest(\Picqer\Financials\Exact\Project::class);
428
    }
429
430
    public function testProjectWBSByProject()
431
    {
432
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectWBSByProject::class);
433
    }
434
435
    public function testShopOrder()
436
    {
437
        $this->performEntityTest(\Picqer\Financials\Exact\ShopOrder::class);
438
    }
439
440
    public function testTimeTransactionEntity()
441
    {
442
        $this->performEntityTest(\Picqer\Financials\Exact\TimeTransaction::class);
443
    }
444
445
    public function testUser()
446
    {
447
        $this->performEntityTest(\Picqer\Financials\Exact\User::class);
448
    }
449
450
    public function testShopOrderMaterialPlan()
451
    {
452
        $this->performEntityTest(\Picqer\Financials\Exact\ShopOrderMaterialPlan::class);
453
    }
454
455
    public function testShopOrderRoutingStepPlan()
456
    {
457
        $this->performEntityTest(\Picqer\Financials\Exact\ShopOrderRoutingStepPlan::class);
458
    }
459
460
    public function testOperation()
461
    {
462
        $this->performEntityTest(\Picqer\Financials\Exact\Operation::class);
463
    }
464
465
    public function testOperationResource()
466
    {
467
        $this->performEntityTest(\Picqer\Financials\Exact\OperationResource::class);
468
    }
469
470
    public function testAbsenceRegistration()
471
    {
472
        $this->performEntityTest(\Picqer\Financials\Exact\AbsenceRegistration::class);
473
    }
474
475
    public function testAbsenceRegistrationTransaction()
476
    {
477
        $this->performEntityTest(\Picqer\Financials\Exact\AbsenceRegistrationTransaction::class);
478
    }
479
480
    public function testDepartment()
481
    {
482
        $this->performEntityTest(\Picqer\Financials\Exact\Department::class);
483
    }
484
485
    public function testDivisionClass()
486
    {
487
        $this->performEntityTest(\Picqer\Financials\Exact\DivisionClass::class);
488
    }
489
490
    public function testDivisionClassName()
491
    {
492
        $this->performEntityTest(\Picqer\Financials\Exact\DivisionClassName::class);
493
    }
494
495
    public function testDivisionClassValue()
496
    {
497
        $this->performEntityTest(\Picqer\Financials\Exact\DivisionClassValue::class);
498
    }
499
500
    public function testJobGroup()
501
    {
502
        $this->performEntityTest(\Picqer\Financials\Exact\JobGroup::class);
503
    }
504
505
    public function testJobTitle()
506
    {
507
        $this->performEntityTest(\Picqer\Financials\Exact\JobTitle::class);
508
    }
509
510
    public function testLeaveBuildUpRegistration()
511
    {
512
        $this->performEntityTest(\Picqer\Financials\Exact\LeaveBuildUpRegistration::class);
513
    }
514
515
    public function testLeaveRegistration()
516
    {
517
        $this->performEntityTest(\Picqer\Financials\Exact\LeaveRegistration::class);
518
    }
519
520
    public function testSchedule()
521
    {
522
        $this->performEntityTest(\Picqer\Financials\Exact\Schedule::class);
523
    }
524
525
    public function testStockBatchNumber()
526
    {
527
        $this->performEntityTest(\Picqer\Financials\Exact\StockBatchNumber::class);
528
    }
529
530
    public function testStockSerialNumber()
531
    {
532
        $this->performEntityTest(\Picqer\Financials\Exact\StockSerialNumber::class);
533
    }
534
535
    public function testWarehouseTransferLine()
536
    {
537
        $this->performEntityTest(\Picqer\Financials\Exact\WarehouseTransferLine::class);
538
    }
539
540
    public function testWarehouseTransfer()
541
    {
542
        $this->performEntityTest(\Picqer\Financials\Exact\WarehouseTransfer::class);
543
    }
544
545
    public function testProductionArea()
546
    {
547
        $this->performEntityTest(\Picqer\Financials\Exact\ProductionArea::class);
548
    }
549
550
    public function testTimedTimeTransaction()
551
    {
552
        $this->performEntityTest(\Picqer\Financials\Exact\TimedTimeTransaction::class);
553
    }
554
555
    public function testWorkcenter()
556
    {
557
        $this->performEntityTest(\Picqer\Financials\Exact\Workcenter::class);
558
    }
559
560
    public function testCostTransaction()
561
    {
562
        $this->performEntityTest(\Picqer\Financials\Exact\CostTransaction::class);
563
    }
564
565
    public function testProjectHourBudget()
566
    {
567
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectHourBudget::class);
568
    }
569
570
    public function testProjectPlanning()
571
    {
572
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectPlanning::class);
573
    }
574
575
    public function testProjectPlanningRecurring()
576
    {
577
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectPlanningRecurring::class);
578
    }
579
580
    public function testProjectRestrictionEmployee()
581
    {
582
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectRestrictionEmployee::class);
583
    }
584
585
    public function testProjectRestrictionItem()
586
    {
587
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectRestrictionItem::class);
588
    }
589
590
    public function testProjectRestrictionRebilling()
591
    {
592
        $this->performEntityTest(\Picqer\Financials\Exact\ProjectRestrictionRebilling::class);
593
    }
594
595
    public function testRecentCost()
596
    {
597
        $this->performEntityTest(\Picqer\Financials\Exact\RecentCost::class);
598
    }
599
600
    public function testRecentHour()
601
    {
602
        $this->performEntityTest(\Picqer\Financials\Exact\RecentHour::class);
603
    }
604
605
    public function testTimeCorrection()
606
    {
607
        $this->performEntityTest(\Picqer\Financials\Exact\TimeCorrection::class);
608
    }
609
610
    public function testEmployment()
611
    {
612
        $this->performEntityTest(\Picqer\Financials\Exact\Employment::class);
613
    }
614
615
    public function testEmploymentContract()
616
    {
617
        $this->performEntityTest(\Picqer\Financials\Exact\EmploymentContract::class);
618
    }
619
620
    public function testActiveEmployment()
621
    {
622
        $this->performEntityTest(\Picqer\Financials\Exact\ActiveEmployment::class);
623
    }
624
625
    public function testOpportunity()
626
    {
627
        $this->performEntityTest(\Picqer\Financials\Exact\Opportunity::class);
628
    }
629
630
    public function testItemWarehouseStorageLocation()
631
    {
632
        $this->performEntityTest(\Picqer\Financials\Exact\ItemWarehouseStorageLocation::class);
633
    }
634
635
    protected function performEntityTest($entityName)
636
    {
637
        $reflectionClass = new \ReflectionClass($entityName);
638
639
        $this->assertTrue($reflectionClass->isInstantiable());
640
        $this->assertTrue($reflectionClass->hasProperty('fillable'));
641
        $this->assertTrue($reflectionClass->hasProperty('url'));
642
        $this->assertEquals('Picqer\Financials\Exact', $reflectionClass->getNamespaceName());
643
        $this->assertEquals('Picqer\Financials\Exact\Model', $reflectionClass->getParentClass()->getName());
644
    }
645
}
646