Exemple #1
0
 /**
  * Indicates if the unit/acceptance tests are run
  * 
  * this is NOT a flag to circumvent tests or behaviour. this is a flag to use the test-datbase for unit-tests
  * @return bool
  */
 public function inTests()
 {
     if (!isset($this->inTests)) {
         $this->inTests = PSC::isTravis() || PSC::isPHPUnit();
     }
     return $this->inTests;
 }
 public function setUp()
 {
     $this->someBody = array('format' => 'xlsx', 'soundExport' => true, 'label' => array('autoComplete' => 'aclabel with spaces', 'remove' => 'remove it'));
     if (\Psc\PSC::isTravis()) {
         $this->markTestSkipped('Kein Webserver bei Travis');
     }
     parent::setUp();
 }
Exemple #3
0
 public function testSmokes()
 {
     if (PSC::isTravis()) {
         $html = '<div class="content"><h1>Mail aus dem Test</h2>Toll, ne?</div>';
         $msg = email::send(email::htmlMessage('Test Mail aus dem Test', $html, '*****@*****.**'));
     } else {
         $this->markTestSkipped('no mailer is configured');
     }
 }
Exemple #4
0
 public function testUserManagerCall()
 {
     if (\Psc\PSC::isTravis()) {
         $this->markTestSkipped('kein lokaler webserver am start');
     }
     $this->main->init($this->request);
     $this->assertCount(2, $this->main->getFrontController()->getRequestHandler()->getServices(), 'Ist EntityService hinzugefügt worden?');
     $this->response = $this->request('GET', '/entities/users/grid');
     $this->assertResponse(200);
 }
Exemple #5
0
 public function setUp()
 {
     $this->chainClass = 'Psc\\System\\Deploy\\Deployer';
     parent::setUp();
     if (\Psc\PSC::isTravis()) {
         $this->markTestSkipped('zu Env abhängig');
     }
     $this->deployments = new \Webforge\Common\System\Dir('D:\\www\\deployments\\');
     $container = new \Webforge\Framework\Container();
     $container->initLocalPackageFromDirectory(new \Webforge\Common\System\Dir(__DIR__ . DIRECTORY_SEPARATOR));
     $this->deployer = clone $this->emptyDeployer = new Deployer($this->deployments, $container, $container->getLocalProject(), new \Psc\System\BufferLogger());
     $this->deployer->init();
     $this->emptyDeployer->addTask($this->emptyDeployer->createTask('CreateAndWipeTarget'));
 }
Exemple #6
0
 public function testInstance()
 {
     $this->assertInstanceOf('Psc\\CMS\\Project', $this->project);
     $base = $this->root->sub('base/');
     /* Pfade */
     $this->assertEquals((string) $this->classPath, (string) $this->project->getClassPath());
     $this->assertEquals((string) $base, (string) $this->project->getBase());
     $this->assertEquals((string) $base->sub('bin/'), (string) $this->project->getBin());
     $this->assertEquals((string) $base->sub('htdocs/'), (string) $this->project->getHtdocs());
     $this->assertEquals((string) $base->sub('files/'), (string) $this->project->getFiles());
     /* Basics */
     $this->assertEquals('MyProject', $this->project->getName());
     $this->assertEquals('myproject', $this->project->getLowerName());
     /* Host Stuff */
     $this->assertEquals('dev1', $this->project->getHost());
     $this->assertInstanceOf('Psc\\Net\\HTTP\\SimpleURL', $this->project->getBaseURL());
     $this->assertEquals('http://myproject.dev1.domain/', (string) $this->project->getBaseURL());
     $this->assertInstanceOf('Psc\\Net\\HTTP\\SimpleURL', $this->project->getTestURL());
     $this->assertEquals('http://test.myproject.dev1.domain/', (string) $this->project->getTestURL());
     if (\Psc\PSC::isTravis()) {
         $this->assertTrue($this->project->isDevelopment());
         // per default production
     } else {
         $this->assertFalse($this->project->isDevelopment());
         // per default production
     }
     /* Class Stuff */
     $this->assertEquals('MyProject', $this->project->getNamespace());
     $this->assertEquals((string) $base->sub('src/MyProject/Data/')->getFile('Object.php'), (string) ($classFile = $this->project->getClassFile('MyProject\\Data\\Object')));
     $this->assertEquals('MyProject\\Data\\Object', $this->project->getClassFromFile($classFile)->getFQN());
     /* Build Stuff */
     $this->assertEquals((string) $base->sub('src/')->getFile('psc-cms.phar.gz'), (string) $this->project->getInstallPharFile());
     $this->assertEquals((string) $base->sub('build/'), (string) $this->project->getBuildPath());
     $this->assertEquals((string) $base->sub('build/special/'), (string) $this->project->getBuildPath('special'));
     /* Modules */
     $this->assertInstanceOf('Psc\\Doctrine\\Module', $m1 = $this->project->getModule('Doctrine'));
     $this->assertInstanceOf('Psc\\Doctrine\\Module', $m2 = $this->project->getModule('Doctrine'));
     $this->assertSame($m1, $m2);
 }
Exemple #7
0
 public function testAddIncludePath()
 {
     /* jetzt wo er leer ist, können wir ja hinzufügen */
     if (PSC::isTravis()) {
         $this->markTestSkipped('include path kann in travis nicht geändert werden');
     }
     $src = (string) $this->getProject()->dir('lib')->sub('notininc');
     $htdocs = (string) $this->getProject()->dir('www');
     $temp = 'D:\\temp\\sessions';
     $env = PSC::getEnvironment();
     $this->assertFalse($env->hasIncludePath($src), 'hasIncludePath');
     $this->assertInstanceOf('\\Psc\\Environment', $env->addIncludePath($src, 'append'));
     $this->assertTrue($env->hasIncludePath($src), 'hasIncludePath');
     $this->assertEquals($this->saveIncludePath . PATH_SEPARATOR . $src, get_include_path());
     $this->assertFalse($env->hasIncludePath($htdocs), 'hasIncludePath');
     $this->assertInstanceOf('\\Psc\\Environment', $env->addIncludePath($htdocs, 'append'));
     $this->assertTrue($env->hasIncludePath($src), 'hasIncludePath');
     $this->assertEquals(get_include_path(), $this->saveIncludePath . PATH_SEPARATOR . $src . PATH_SEPARATOR . $htdocs);
     $this->assertFalse($env->hasIncludePath($temp), 'hasIncludePath');
     $this->assertInstanceOf('\\Psc\\Environment', $env->addIncludePath($temp));
     // prepend ist default
     $this->assertTrue($env->hasIncludePath($temp), 'hasIncludePath');
     $this->assertEquals(get_include_path(), $temp . PATH_SEPARATOR . $this->saveIncludePath . PATH_SEPARATOR . $src . PATH_SEPARATOR . $htdocs);
 }
Exemple #8
0
 public function isDevelopment()
 {
     if (!isset($this->development)) {
         $this->development = FALSE;
         if ($this->hostConfig->get('development') !== NULL) {
             return $this->development = (bool) $this->hostConfig->get('development');
         }
         $ua = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : FALSE;
         if ($ua === $this->hostConfig->get('uagent-key')) {
             return $this->development = TRUE;
         }
         if ($this->getConfiguration()->get('developer') === TRUE) {
             return $this->development = TRUE;
         }
         if (PSC::isTravis()) {
             return $this->development = TRUE;
         }
     }
     return $this->development;
 }