Ejemplo n.º 1
0
 public function testModule()
 {
     /** @var \MOC\V\Component\Captcha\Component\Bridge\Bridge $MockBridge */
     $MockBridge = $this->getMockBuilder('MOC\\V\\Component\\Captcha\\Component\\Bridge\\Bridge')->getMock();
     $Vendor = new Vendor(new $MockBridge());
     $Module = new Captcha($Vendor);
     $this->assertInstanceOf('MOC\\V\\Component\\Captcha\\Component\\IVendorInterface', $Module->getVendorInterface());
     $this->assertInstanceOf('MOC\\V\\Component\\Captcha\\Component\\IVendorInterface', $Module->setBridgeInterface($MockBridge));
     $this->assertInstanceOf('MOC\\V\\Component\\Captcha\\Component\\IBridgeInterface', $Module->getBridgeInterface());
 }
Ejemplo n.º 2
0
 /**
  * @param string         $Name
  * @param null|string    $Placeholder
  * @param null|string    $Label
  * @param IIconInterface $Icon
  */
 public function __construct($Name, $Placeholder = '', $Label = '', IIconInterface $Icon = null)
 {
     $this->Name = $Name;
     $this->Template = $this->getTemplate(__DIR__ . '/TextCaptcha.twig');
     $this->Template->setVariable('ElementName', $Name);
     $this->Template->setVariable('ElementLabel', $Label);
     $this->Template->setVariable('ElementPlaceholder', $Placeholder);
     if (null !== $Icon) {
         $this->Template->setVariable('ElementIcon', $Icon);
     }
     $this->Template->setVariable('ElementSource', Captcha::getCaptcha()->createCaptcha()->getCaptcha());
 }
Ejemplo n.º 3
0
use MOC\V\Core\AutoLoader\AutoLoader;
/**
 * Setup: Php
 */
header('Content-type: text/html; charset=utf-8');
error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start();
session_write_close();
date_default_timezone_set('Europe/Berlin');
/**
 * Setup: Loader
 */
require_once __DIR__ . '/../../Core/AutoLoader/AutoLoader.php';
AutoLoader::getNamespaceAutoLoader('\\MOC\\V', __DIR__ . '/../../');
var_dump(Captcha::getCaptcha()->createCaptcha()->getCaptcha());
/*
$File = FileSystem::getUniversalFileLoader( __FILE__ );
var_dump( $File->getLocation() );
var_dump( $File->getRealPath() );

$File = FileSystem::getSymfonyFinder( __FILE__ );
var_dump( $File->getLocation() );
var_dump( $File->getRealPath() );

$File = FileSystem::getSymfonyFinder( '/TestSuite/Console/index.php' );
var_dump( $File->getLocation() );
var_dump( $File->getRealPath() );

$File = FileSystem::getUniversalFileLoader( '/TestSuite/Console/index.php' );
var_dump( $File->getLocation() );
Ejemplo n.º 4
0
 /**
  * @return IBridgeInterface
  */
 public static function getSimplePhpCaptcha()
 {
     $Doctrine = new Captcha(new Vendor(new SimplePhpCaptcha()));
     return $Doctrine->getBridgeInterface();
 }