Exemplo n.º 1
0
 public function setup()
 {
     parent::setup();
     $this->controller = $this->prophesize("Ethna_Controller");
     $this->event_dispatcher = $this->prophesize('\\Symfony\\Component\\EventDispatcher\\EventDispatcher');
     $this->backend = $this->prophesize("Ethna_Backend");
     $this->i18n = $this->prophesize("Ethna_I18N");
     $this->action_error = $this->prophesize("Ethna_ActionError");
     $this->plugin = $this->prophesize("Ethna_Plugin");
     $this->logger = $this->prophesize("Ethna_Logger");
     $this->controller->getEventDispatcher()->willReturn($this->event_dispatcher);
     $this->event_dispatcher->dispatch(Argument::type('string'), Argument::any())->will(function ($args, $event) {
         $action_form = $args[1]->getActionForm();
         $target = null;
         if ($_SERVER['REQUEST_METHOD'] == 'GET') {
             $target =& $_GET;
         } else {
             $target = $_POST;
         }
         foreach ($target as $key => $value) {
             $action_form->set($key, $value);
         }
     });
     $this->backend->getController()->willReturn($this->controller);
     $this->controller->getBackend()->willReturn($this->backend);
     $this->controller->getActionError()->willReturn($this->action_error);
     $this->controller->getI18N()->willReturn($this->i18n);
     $this->controller->getLogger()->willReturn($this->logger);
     $this->controller->getPlugin()->willReturn($this->plugin);
 }
Exemplo n.º 2
0
 protected function setUp()
 {
     parent::setUp();
     $this->mockBuildLogger = $this->prophesize('\\PHPCI\\Logging\\BuildLogger');
     $this->mockFactory = $this->prophesize('\\PHPCI\\Plugin\\Util\\Factory');
     $this->testedExecutor = new Executor($this->mockFactory->reveal(), $this->mockBuildLogger->reveal());
 }
 protected function setUp()
 {
     if (!class_exists('AMQPConnection')) {
         $this->markTestSkipped('The AMQP extension is not available');
     }
     parent::setUp();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->parser = $this->prophesize('Pitech\\MailerBundle\\Parser\\FileParserInterface');
     $this->translator = $this->prophesize('Symfony\\Component\\Translation\\TranslatorInterface');
     $this->templating = $this->prophesize('Pitech\\MailerBundle\\Templating\\TemplatingInterface');
 }
 protected function setUp()
 {
     parent::setUp();
     $this->mailResolver = $this->prophesize('Pitech\\MailerBundle\\Resolver\\MailResolver');
     $this->event = $this->prophesize('Pitech\\MailerBundle\\Event\\MailEvent');
     $this->class = new EventEmailSubscriber($this->mailResolver->reveal());
 }
Exemplo n.º 6
0
 function setUp()
 {
     parent::setUp();
     $this->cache = $this->prophesize("Wilson\\Utils\\Cache");
     $this->ut = $this->prophesize("Wilson\\Routing\\UrlTools");
     $this->router = new Router($this->cache->reveal(), $this->ut->reveal());
 }
Exemplo n.º 7
0
 protected function setUp()
 {
     parent::setUp();
     $this->mockLogger = $this->prophesize('\\Psr\\Log\\LoggerInterface');
     $this->mockBuild = $this->prophesize('\\PHPCI\\Model\\Build');
     $this->testedBuildLogger = new BuildLogger($this->mockLogger->reveal(), $this->mockBuild->reveal());
 }
Exemplo n.º 8
0
 protected function setup()
 {
     parent::setup();
     $this->blank = new DefaultTree([], false);
     $this->full = new DefaultTree(['some' => ['entity' => ['edit' => false, 'delete' => false, 'view' => false], 'resource' => ['edit' => false]]], false);
     $this->inverse = new DefaultTree(['app' => ['res' => ['main' => ['see' => true]]], 'some' => ['entity' => ['delete' => true]]], true);
 }
 protected function setUp()
 {
     parent::setUp();
     $this->filtersCache = $this->prophesize('Pitech\\FiltersBundle\\Annotations\\FiltersCache');
     $this->dir = __DIR__ . '/../Resources/public';
     $this->class = new FilterFieldReader($this->filtersCache->reveal(), $this->dir);
 }
Exemplo n.º 10
0
 protected function setUp()
 {
     parent::setUp();
     $this->mockBugsnag = $this->prophesize('\\Bugsnag_Client');
     $this->testedHandler = new BugsnagHandler($this->mockBugsnag->reveal());
     $this->monolog = new Logger("TestLogger");
     $this->monolog->pushHandler($this->testedHandler);
 }
 public function setUp()
 {
     parent::setup();
     $groupData = "\nwest:\n  lists:\n    webminister:\n      members:\n        - minister@sca.org\n        - deputy@sca.org\n      properties:\n        group-name: West Kingdom Web Minister";
     $this->initialState = Yaml::parse(trim($groupData));
     $properties = array('top-level-group' => 'north', 'subdomains' => 'fogs,geese,wolves,lightwoods');
     $this->policy = new StandardGroupPolicy('testdomain.org', $properties);
 }
Exemplo n.º 12
0
 protected function setUp()
 {
     parent::setUp();
     $this->mailer = $this->prophesize('\\Swift_Mailer');
     $this->logger = $this->prophesize('Psr\\Log\\LoggerInterface');
     $this->message = $this->prophesize('Pitech\\MailerBundle\\Model\\MailMessageInterface');
     $this->class = new SwiftMailer($this->mailer->reveal(), $this->logger->reveal());
 }
Exemplo n.º 13
0
 protected function setUp()
 {
     parent::setUp();
     $this->mailer = $this->prophesize('Pitech\\MailerBundle\\Mailer\\MailerInterface');
     $this->provider = $this->prophesize('Pitech\\MailerBundle\\Provider\\MailerProviderInterface');
     $this->message = $this->prophesize('Pitech\\MailerBundle\\Model\\MailMessageInterface');
     $this->class = new MailResolver(self::$defaults, $this->mailer->reveal(), $this->provider->reveal());
 }
 public function setUp()
 {
     parent::setup();
     $groupData = "\nwest:\n  lists:\n    webminister:\n      members:\n        - minister@sca.org\n        - deputy@sca.org\n      properties:\n        group-name: West Kingdom Web Minister";
     $this->initialState = Yaml::parse(trim($groupData));
     $properties = array('top-level-group' => 'north', 'primary-office' => 'president', 'subdomains' => 'fogs,geese,wolves,lightwoods', 'aggregated-groups' => "\nlesseroffices:\n  members:\n    - vice-president\n    - secretary\n    - gophers\n  properties:\n    group-name: '\${branch} Lesser Officers'");
     $this->policy = new StandardGroupPolicy('testdomain.org', $properties);
 }
Exemplo n.º 15
0
 protected function setUp()
 {
     parent::setUp();
     $this->event = $this->prophesize('Composer\\Script\\Event');
     $this->io = $this->prophesize('Composer\\IO\\IOInterface');
     $this->package = $this->prophesize('Composer\\Package\\PackageInterface');
     $composer = $this->prophesize('Composer\\Composer');
     $composer->getPackage()->willReturn($this->package);
     $this->event->getComposer()->willReturn($composer);
     $this->event->getIO()->willReturn($this->io);
 }
Exemplo n.º 16
0
 protected function setup()
 {
     parent::setup();
     $provider = $this->prophesize('AclBundle\\Access\\PolicyProviderInterface');
     $builder = $this->prophesize('AclBundle\\Resource\\Builder');
     $trans = $this->prophesize('AclBundle\\Resource\\Transformer\\Transformator');
     $builder->tree()->willReturn(new DefaultTree(['resource' => ['edit' => false, 'view' => false], 'app' => ['edit' => false]], false));
     $provider->policies()->willReturn(['resource.view' => true, 'app' => true]);
     $this->acl = new DecisionManager($builder->reveal(), $trans->reveal());
     $this->acl->provider($provider->reveal());
 }
 protected function tearDown()
 {
     parent::tearDown();
     foreach ($this->environmentBackup as $var => $value) {
         if (false === $value) {
             putenv($var);
         } else {
             putenv($var . '=' . $value);
         }
     }
 }
Exemplo n.º 18
0
 public function setup()
 {
     parent::setup();
     // Current command, we need to mock all method that interact with
     // Database & File system.
     $this->command = $this->getMockBuilder('PHPCI\\Command\\InstallCommand')->setMethods(array('reloadConfig', 'verifyNotInstalled', 'verifyDatabaseDetails', 'setupDatabase', 'createAdminUser', 'writeConfigFile'))->getMock();
     $this->command->expects($this->once())->method('verifyDatabaseDetails')->willReturn(true);
     $this->command->expects($this->once())->method('setupDatabase')->willReturn(true);
     $this->command->expects($this->once())->method('createAdminUser')->will($this->returnCallback(function ($adm) {
         // use (&$admin) {
         $this->admin = $adm;
     }));
     $this->command->expects($this->once())->method('writeConfigFile')->will($this->returnCallback(function ($cfg) {
         //use (&$config) {
         $this->config = $cfg;
     }));
     // We check that there's no interaction with user.
     $this->dialog = $this->getMockBuilder('Symfony\\Component\\Console\\Helper\\DialogHelper')->setMethods(array('ask', 'askConfirmation', 'askAndValidate', 'askHiddenResponse', 'askHiddenResponseAndValidate'))->getMock();
     $this->application = new Application();
     $this->application->setHelperSet(new HelperSet());
 }
Exemplo n.º 19
0
 public function setup()
 {
     parent::setup();
     $this->controller = $this->prophesize("Ethna_Controller");
     $this->config = $this->prophesize("Ethna_Config");
     $this->i18n = $this->prophesize("Ethna_I18N");
     $this->action_error = $this->prophesize("Ethna_ActionError");
     $this->action_form = $this->prophesize("Ethna_ActionForm");
     $this->action_class = $this->prophesize("Ethna_ActionClass");
     $this->session = $this->prophesize("Ethna_Session");
     $this->plugin = $this->prophesize("Ethna_Plugin");
     $this->logger = $this->prophesize("Ethna_Logger");
     $this->class_factory = $this->prophesize("Ethna_ClassFactory");
     $this->controller->getClassFactory()->willReturn($this->class_factory);
     $this->controller->getConfig()->willReturn($this->config);
     $this->controller->getI18N()->willReturn($this->i18n);
     $this->controller->getActionError()->willReturn($this->action_error);
     $this->controller->getActionForm()->willReturn($this->action_form);
     $this->controller->getSession()->willReturn($this->session);
     $this->controller->getPlugin()->willReturn($this->plugin);
     $this->controller->getLogger()->willReturn($this->logger);
 }
Exemplo n.º 20
0
 public function setup()
 {
     parent::setup();
     $this->controller = $this->prophesize("Ethna_Controller");
     $this->backend = $this->prophesize("Ethna_Backend");
     $this->config = $this->prophesize("Ethna_Config");
     $this->i18n = $this->prophesize("Ethna_I18N");
     $this->action_error = $this->prophesize("Ethna_ActionError");
     $this->action_form = $this->prophesize("Ethna_ActionForm");
     $this->session = $this->prophesize("Ethna_Session");
     $this->plugin = $this->prophesize("Ethna_Plugin");
     $this->logger = $this->prophesize("Ethna_Logger");
     $this->backend->getLogger()->willReturn($this->logger);
     $this->backend->getPlugin()->willReturn($this->plugin);
     $this->backend->getSession()->willReturn($this->session);
     $this->backend->getActionForm()->willReturn($this->action_form);
     $this->backend->getActionError()->willReturn($this->action_error);
     $this->backend->getI18N()->willReturn($this->i18n);
     $this->backend->getConfig()->willReturn($this->config);
     $this->backend->getController()->willReturn($this->controller);
     $this->controller->getBackend()->willReturn($this->backend);
 }
 protected function tearDown()
 {
     $filesystem = new Filesystem();
     if (is_dir(__DIR__ . '/database')) {
         $filesystem->remove(__DIR__ . '/database');
     }
     parent::tearDown();
 }
Exemplo n.º 22
0
 protected function setup()
 {
     parent::setup();
     $this->builder = new Builder([false, null, null, true]);
     $this->provider = $this->prophesize('AclBundle\\Resource\\ProviderInterface');
 }
Exemplo n.º 23
0
 protected function onNotSuccessfulTest(\Exception $e)
 {
     if ($e instanceof asserter\exception) {
         $e = new \PHPUnit_Framework_AssertionFailedError($e->getMessage(), $e->getCode());
     }
     return parent::onNotSuccessfulTest($e);
 }
Exemplo n.º 24
0
 protected function setUp()
 {
     parent::setup();
     $this->testedInterpolator = new BuildInterpolator();
 }
Exemplo n.º 25
0
 protected function setUp()
 {
     parent::setUp();
     $this->filePath = sprintf('%s%s', __DIR__, self::TEST_FILE_PATH);
     $this->class = new YamlParser();
 }
Exemplo n.º 26
0
 protected function setUp()
 {
     parent::setUp();
     $mockBuildLogger = $this->prophesize('PHPCI\\Logging\\BuildLogger');
     $this->testedExecutor = new UnixCommandExecutor($mockBuildLogger->reveal(), __DIR__ . "/");
 }
 public function setUp()
 {
     parent::setup();
 }
Exemplo n.º 28
0
 protected function setUp()
 {
     parent::setUp();
     $this->twigEngine = $this->prophesize('Symfony\\Bundle\\TwigBundle\\TwigEngine');
     $this->class = new TwigTemplating($this->twigEngine->reveal());
 }
Exemplo n.º 29
0
 protected function setUp()
 {
     parent::setUp();
     $this->client = $this->prophesize('Devhelp\\Piwik\\Api\\Client\\PiwikClient');
 }
Exemplo n.º 30
0
 protected function setUp()
 {
     parent::setUp();
     $this->user = $this->getUserProvider()->loadUserByUsername($this->username);
     $this->session = new Session($this->getChunkFileManager(), $this->getReferenceManager(), $this->getTreeManager(), $this->getCommitManager(), $this->user, $this->referenceName);
 }