. * * The interactive user interfaces in modified source and object code versions * of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ namespace tests\integration\Espo\Tools\AppSecret; use Espo\Core\Utils\Crypt; use Espo\Entities\AppSecret; use Espo\Tools\AppSecret\SecretProvider; use tests\integration\Core\BaseTestCase; class SecretProviderTest extends BaseTestCase { public function testGet(): void { $em = $this->getEntityManager(); $provider = $this->getInjectableFactory()->create(SecretProvider::class); $secret = $em->getRDBRepositoryByClass(AppSecret::class)->getNew(); $crypt = $this->getInjectableFactory()->create(Crypt::class); $value = 'hello'; $secret ->setName('test') ->setSecretValue($crypt->encrypt($value)); $em->saveEntity($secret); $this->assertEquals( $value, $provider->get('test') ); $this->assertNull($provider->get('Test')); } }