public function setUp()
 {
     parent::setUp();
     $this->kernel = new AppKernel('test', true);
     $this->kernel->boot();
     $this->container = $this->kernel->getContainer();
 }
Exemplo n.º 2
0
 public function tearDown()
 {
     $this->doctrineContainer->getConnection()->close();
     $em = $this->doctrineContainer->getEntityManager();
     $tool = new \Doctrine\ORM\Tools\SchemaTool($em);
     $tool->dropDatabase();
     parent::tearDown();
 }
Exemplo n.º 3
0
 public function setUp()
 {
     parent::setUp();
     if (self::APIKEY == "" or !in_array(self::ACCOUNTTYPE, array("starter", "basic", "pro"))) {
         $this->markTestSkipped('Please fill APIKEY & ACCOUNT.');
     }
     $this->rajaongkir = new RajaOngkir(self::APIKEY, self::ACCOUNTTYPE);
 }
Exemplo n.º 4
0
 public function setUp()
 {
     parent::setUp();
     $config = new \Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', null, true);
     $system_ini = new \Zend_Config_Ini('/var/yujiaqu.ini');
     $config->merge($system_ini);
     $application = new Zend_Application(APPLICATION_ENV, $config->get(APPLICATION_ENV));
     $application->bootstrap();
     $this->_bootstrap = $application->getBootstrap();
     // manually init Zend_Controller_Front, otherwise, it is not inited in testing environment
     $this->_bootstrap->getResource('FrontController')->setParam('bootstrap', $this->_bootstrap);
     $this->_angel_bootstrap = $this->_bootstrap->getResource('modules')->offsetGet('angel');
     $this->_container = $this->_bootstrap->getResource('serviceContainer');
     $this->_documentManager = $this->_angel_bootstrap->getResource('mongoDocumentManager');
     $this->_logger = $this->_bootstrap->getResource('logger');
 }
 public function setUp()
 {
     parent::setUp();
     $this->folderOperator = $this->getMockBuilder('Xi\\Filelib\\Folder\\DefaultFolderOperator')->disableOriginalConstructor()->getMock();
     $this->fileOperator = $this->getMockBuilder('Xi\\Filelib\\File\\DefaultFileOperator')->disableOriginalConstructor()->getMock();
     // mock an stdClass while problems mocking a proper FileUpload class
     // $this->fileUpload = $this->getMockBuilder('Xi\Filelib\File\Upload\FileUpload')->disableOriginalConstructor()->getMock();
     $this->fileUpload = $this->getMockBuilder('\\StdClass')->disableOriginalConstructor()->setMethods(array('setOverrideFilename'))->getMock();
     $this->fileOperator->expects($this->any())->method('prepareUpload')->will($this->returnValue($this->fileUpload));
     $this->filelib = $this->getMockBuilder('Xi\\Filelib\\FileLibrary')->disableOriginalConstructor()->getMock();
     $this->filelib->expects($this->any())->method('getFolderOperator')->will($this->returnValue($this->folderOperator));
     $this->filelib->expects($this->any())->method('getFileOperator')->will($this->returnValue($this->fileOperator));
     $this->formFactory = $this->getMockBuilder('Symfony\\Component\\Form\\FormFactory')->disableOriginalConstructor()->getMock();
     $this->service = new FilebrowserService($this->filelib, $this->formFactory, array('folder' => 'puuppa'));
     $this->folder = $this->getMockBuilder('Xi\\Filelib\\Folder\\Folder')->disableOriginalConstructor()->getMock();
     $this->uploadedFile = $this->getMockBuilder('Symfony\\Component\\HttpFoundation\\File\\UploadedFile')->disableOriginalConstructor()->getMock();
 }
Exemplo n.º 6
0
 /**
  * Setup para iniciação de cada teste
  * 
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->frete = new RsCorreios();
     $this->webServiceUrl = "http://ws.correios.com.br";
     $this->webServiceUrl .= "/calculador/CalcPrecoPrazo.asmx/CalcPrecoPrazo";
     $this->resposta = '<?xml version="1.0" encoding="ISO-8859-1" ?>';
     $this->resposta .= '<Servicos><cServico>';
     $this->resposta .= '<Codigo>41106</Codigo>';
     $this->resposta .= '<Valor>10,50</Valor>';
     $this->resposta .= '<PrazoEntrega>3</PrazoEntrega>';
     $this->resposta .= '<ValorMaoPropria>0,00</ValorMaoPropria>';
     $this->resposta .= '<ValorAvisoRecebimento>';
     $this->resposta .= '0,00</ValorAvisoRecebimento>';
     $this->resposta .= '<ValorValorDeclarado>0,00</ValorValorDeclarado>';
     $this->resposta .= '<EntregaDomiciliar>S</EntregaDomiciliar>';
     $this->resposta .= '<EntregaSabado>N</EntregaSabado>';
     $this->resposta .= '<Erro>0</Erro>';
     $this->resposta .= '<MsgErro></MsgErro>';
     $this->resposta .= '</cServico></Servicos>';
 }
Exemplo n.º 7
0
 public function setUp()
 {
     parent::setUp();
     $this->acl = new ZF_App_ACL();
 }
Exemplo n.º 8
0
 public function __construct()
 {
     $this->config = ['max_retries' => 0, 'http_client_options' => ['defaults' => ['proxy' => $this->proxy, 'verify' => $this->verifySsl]], 'apiToken' => getenv('TYPEFORM_API_TOKEN')];
     parent::__construct();
 }
Exemplo n.º 9
0
 public function setUp()
 {
     parent::setUp();
     $this->ele = new ArrayElement('email', 'text', []);
     $this->ele->setLabel('Email');
 }
Exemplo n.º 10
0
 function clickLink($label, $index = 0, $fuzzy = false)
 {
     if (!$fuzzy) {
         return parent::clickLink($label, $index);
     }
     $url_before = str_replace('%', '%%', $this->getUrl());
     $urls = $this->getUrlsByLabel($label, true);
     if (count($urls) < $index + 1) {
         $url_target = 'URL NOT FOUND!';
     } else {
         $url_target = str_replace('%', '%%', $urls[$index]->asString());
     }
     $this->_browser->_load($urls[$index], new SimpleGetEncoding());
     $ret = $this->_failOnError($this->_browser->getContent());
     $this->assertTrue($ret, ' [browser] clicked link ' . t($label) . " ({$url_target}) from {$url_before}");
     return $ret;
 }
Exemplo n.º 11
0
 public function tearDown()
 {
     parent::tearDown();
     unset($this->kyew);
 }