Skip to content

Commit 3d1142d

Browse files
author
Davert
committed
some fixes for symfony 2.2
1 parent e58bd15 commit 3d1142d

6 files changed

Lines changed: 13 additions & 24 deletions

File tree

bin/build_phar.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,25 @@
77

88
// download composer
99

10-
if (!file_exists('composer.phar')) {
11-
file_put_contents('composer.phar', file_get_contents('http://getcomposer.org/installer'));
12-
}
13-
system('php composer.phar update');
10+
//if (!file_exists('composer.phar')) {
11+
// file_put_contents('composer.phar', file_get_contents('http://getcomposer.org/installer'));
12+
//}
13+
//system('php composer.phar update');
1414

15+
chdir($root);
1516
$compiler = new Compiler();
1617
$compiler->compile();
1718

18-
@unlink('package/codecept.phar');
19-
2019
if (file_exists('codecept.phar.gz')) {
2120
chmod('codecept.phar.gz', 755);
2221
copy('codecept.phar.gz', 'package/codecept.phar');
2322
} else {
24-
chmod('codecept.phar', 755);
2523
copy('codecept.phar', 'package/codecept.phar');
24+
@exec('chmod 755 package/codecept.phar');
2625
}
2726
@unlink('codecept.phar');
2827
@unlink('codecept.phar.gz');
2928

30-
chmod('package/codecept.phar', 755);
31-
3229
echo system('php package/codecept.phar');
3330

34-
echo "PHAR build finished";
31+
echo "\nPHAR build finished\n\n";

codecept

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@
44
* Codeception CLI
55
*/
66

7-
if (!class_exists('UniversalClassLoader')) {
8-
$bootstrap_folder = (is_dir(__DIR__ . '/src'))
9-
? dirname(__FILE__)
10-
: 'Codeception';
11-
12-
require_once $bootstrap_folder.'/autoload.php';
13-
}
7+
require_once dirname(__FILE__).'/autoload.php';
148

159
if (isset($argv[1])) {
1610
if (!in_array('run', $argv)) {

package/codecept.phar

-25 Bytes
Binary file not shown.

package/stub.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
<?php
33
Phar::mapPhar();
44

5-
chdir(__DIR__);
6-
75
require_once 'phar://codecept.phar/autoload.php';
86

97
require_once 'phar://codecept.phar/codecept';

src/Codeception/Module/Doctrine2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function _before(\Codeception\TestCase $test)
5252
if ($this->hasModule('Symfony2')) {
5353
$kernel = $this->getModule('Symfony2')->kernel;
5454
if ($kernel->getContainer()->has('doctrine')) {
55-
self::$em = $kernel->getContainer()->get('doctrine')->getEntityManager();
55+
self::$em = $kernel->getContainer()->get('doctrine.orm.entity_manager');
5656
}
5757
}
5858
}

src/Codeception/Module/Symfony2.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?php
22
namespace Codeception\Module;
3+
34
use Codeception\Exception\ModuleRequire;
45
use Symfony\Component\Finder\Finder;
6+
use Symfony\Component\HttpKernel\Exception\FlattenException;
7+
use Symfony\Component\HttpKernel\Exception\HttpException;
8+
use Symfony\Component\HttpFoundation\Response;
59

610
/**
711
* This module uses Symfony2 Crawler and HttpKernel to emulate requests and get response.
@@ -60,10 +64,6 @@ public function _initialize() {
6064
require_once $cache;
6165
$this->kernelClass = $this->getKernelClass();
6266
$this->kernel = new $this->kernelClass('test', true);
63-
$this->kernel->boot();
64-
if (!($this->kernel->getContainer() instanceof \Symfony\Component\DependencyInjection\ContainerInterface)) {
65-
throw new ModuleRequire(__CLASS__,"Wrong container in Kernel (not implements ContainerInterface)");
66-
}
6767
}
6868

6969
public function _before(\Codeception\TestCase $test) {

0 commit comments

Comments
 (0)