GoogleRecaptchaTest::test_initFromEnviroment()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
namespace ByTIC\GoogleRecaptcha\Tests\Utility;
4
5
use ByTIC\GoogleRecaptcha\RecaptchaManager;
6
use ByTIC\NewRelic\NewRelicAgent;
0 ignored issues
show
Bug introduced by
The type ByTIC\NewRelic\NewRelicAgent 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...
7
use ByTIC\GoogleRecaptcha\Tests\AbstractTest;
8
use ByTIC\GoogleRecaptcha\Utility\GoogleRecaptcha;
9
use Dotenv\Dotenv;
10
use Mockery;
11
12
/**
13
 * Class GoogleRecaptchaTest
14
 * @package ByTIC\NewRelic\Tests\Utility
15
 */
16
class GoogleRecaptchaTest extends AbstractTest
17
{
18
19
    public function test_initFromEnviroment()
20
    {
21
        $dotenv = \Dotenv\Dotenv::createImmutable(TEST_FIXTURE_PATH, '.env.generic');
22
        $dotenv->load();
23
24
        $manager = GoogleRecaptcha::getManager();
25
26
        static::assertInstanceOf(RecaptchaManager::class, $manager);
27
        self::assertTrue( $manager->isEnabled());
28
        self::assertSame('my-key', $manager->getSiteKey());
29
        self::assertSame('my-secret', $manager->getSecretKey());
30
    }
31
}
32