• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NIT-Administrative-Systems / dynamic-forms / 13506324421

24 Feb 2025 07:35PM UTC coverage: 59.275% (-34.7%) from 94.003%
13506324421

Pull #480

github

nie7321
Update ComponentRegistryTest.php
Pull Request #480: Laravel 12

818 of 1380 relevant lines covered (59.28%)

45.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

11.11
/src/Storage/FileDriver.php
1
<?php
2

3
namespace Northwestern\SysDev\DynamicForms\Storage;
4

5
class FileDriver implements StorageInterface
6
{
7
    /** @var string */
8
    const STORAGE_URL = 'url';
9

10
    /**
11
     * @inheritDoc
12
     */
13
    public function findObject(string $key): bool
14
    {
15
        return \File::exists(storage_path('app/uploaded/'.$key));
×
16
    }
17

18
    public function isValid(mixed $value): bool
19
    {
20
        // Check if all fields exist
21
        if (! isset($value) || ! isset($value['name']) || ! isset($value['url']) || ! isset($value['data']) ||
×
22
            ! isset($value['data']['baseUrl']) || ! isset($value['data']['project']) || ! isset($value['data']['form'])) {
×
23
            return false;
×
24
        }
25

26
        // Check consistency of fields
27
        $expectedUrl = route('dynamic-forms.url-file-download').'?baseUrl='.urlencode($value['data']['baseUrl']).'&project=&form=/'.$value['name'];
×
28
        if ($expectedUrl != $value['url']) {
×
29
            return false;
×
30
        }
31

32
        return $this->findObject($value['name']);
×
33
    }
34

35
    public static function getStorageMethod(): string
36
    {
37
        return self::STORAGE_URL;
12✔
38
    }
39
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc