Skip to content

Commit

Permalink
Release 4.0.0-beta.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-parry committed May 6, 2019
1 parent 5b5ccfe commit 4fc8c85
Show file tree
Hide file tree
Showing 240 changed files with 2,957 additions and 1,651 deletions.
20 changes: 3 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,12 @@ The user guide updating and deployment is a bit awkward at the moment, but we ar

## Repository Management

We use Github issues to track **BUGS** and to track approved **DEVELOPMENT** work packages.
We use Github issues, in our main repository, to track **BUGS** and to track approved **DEVELOPMENT** work packages.
We use our [forum](http://forum.codeigniter.com) to provide SUPPORT and to discuss
FEATURE REQUESTS.

If you raise an issue here that pertains to support or a feature request, it will
be closed! If you are not sure if you have found a bug, raise a thread on the forum first -
someone else may have encountered the same thing.

Before raising a new Github issue, please check that your bug hasn't already
been reported or fixed.

We use pull requests (PRs) for CONTRIBUTIONS to the repository.
We are looking for contributions that address one of the reported bugs or
approved work packages.

Do not use a PR as a form of feature request.
Unsolicited contributions will only be considered if they fit nicely
into the framework roadmap.
Remember that some components that were part of CodeIgniter 3 are being moved
to optional packages, with their own repository.
This repository is a "distribution" one, built by our release preparation script.
Problems with it can be raised on our forum, or as issues in the main repository.

## Contributing

Expand Down
19 changes: 19 additions & 0 deletions _support/Controllers/Popcorn.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,23 @@ public function index3()
return $response;
}

public function canyon()
{
echo 'Hello-o-o';
}

public function cat()
{
}

public function json()
{
$this->responsd(['answer' => 42]);
}

public function xml()
{
$this->respond('<my><pet>cat</pet></my>');
}

}
36 changes: 33 additions & 3 deletions _support/Database/Migrations/20160428212500_Create_test_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ public function up()
'constraint' => 1,
'default' => '0',
],
'created_at' => [
'type' => 'DATETIME',
'null' => true,
],
'updated_at' => [
'type' => 'DATETIME',
'null' => true,
],
]);
$this->forge->addKey('id', true);
$this->forge->createTable('user', true);
Expand All @@ -46,11 +54,25 @@ public function up()
'type' => 'VARCHAR',
'constraint' => 40,
],
'description' => ['type' => 'TEXT'],
'created_at' => [
'type' => 'DATETIME',
'description' => [
'type' => 'TEXT',
'null' => true,
],
'deleted' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => '0',
],
'created_at' => [
'type' => 'INTEGER',
'constraint' => 11,
'null' => true,
],
'updated_at' => [
'type' => 'INTEGER',
'constraint' => 11,
'null' => true,
],
]);
$this->forge->addKey('id', true);
$this->forge->createTable('job', true);
Expand Down Expand Up @@ -82,6 +104,14 @@ public function up()
'type' => 'VARCHAR',
'constraint' => 40,
],
'created_at' => [
'type' => 'DATE',
'null' => true,
],
'updated_at' => [
'type' => 'DATE',
'null' => true,
],
]);
$this->forge->addKey('id', true);
$this->forge->createTable('empty', true);
Expand Down
45 changes: 32 additions & 13 deletions _support/Database/MockConnection.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace Tests\Support\Database;

use CodeIgniter\CodeIgniter;
use CodeIgniter\Database\BaseConnection;

class MockConnection extends BaseConnection
Expand All @@ -21,7 +22,23 @@ public function shouldReturn(string $method, $return)

//--------------------------------------------------------------------

public function query(string $sql, $binds = null, bool $setEscapeFlags = true, $queryClass = 'CodeIgniter\\Database\\Query')
/**
* Orchestrates a query against the database. Queries must use
* Database\Statement objects to store the query and build it.
* This method works with the cache.
*
* Should automatically handle different connections for read/write
* queries if needed.
*
* @param string $sql
* @param mixed ...$binds
* @param boolean $setEscapeFlags
* @param string $queryClass
*
* @return \CodeIgniter\Database\BaseResult|\CodeIgniter\Database\Query|false
*/

public function query(string $sql, $binds = null, bool $setEscapeFlags = true, string $queryClass = 'CodeIgniter\\Database\\Query')
{
$queryClass = str_replace('Connection', 'Query', get_class($this));

Expand Down Expand Up @@ -60,9 +77,11 @@ public function query(string $sql, $binds = null, bool $setEscapeFlags = true, $
/**
* Connect to the database.
*
* @param boolean $persistent
*
* @return mixed
*/
public function connect($persistent = false)
public function connect(bool $persistent = false)
{
$return = $this->returnValues['connect'] ?? true;

Expand All @@ -82,9 +101,9 @@ public function connect($persistent = false)
* Keep or establish the connection if no queries have been sent for
* a length of time exceeding the server's idle timeout.
*
* @return mixed
* @return boolean
*/
public function reconnect()
public function reconnect(): bool
{
return true;
}
Expand All @@ -110,23 +129,23 @@ public function setDatabase(string $databaseName)
/**
* Returns a string containing the version of the database being used.
*
* @return mixed
* @return string
*/
public function getVersion()
public function getVersion(): string
{
return \CodeIgniter\CodeIgniter::CI_VERSION;
return CodeIgniter::CI_VERSION;
}

//--------------------------------------------------------------------

/**
* Executes the query against the database.
*
* @param $sql
* @param string $sql
*
* @return mixed
*/
protected function execute($sql)
protected function execute(string $sql)
{
return $this->returnValues['execute'];
}
Expand All @@ -136,7 +155,7 @@ protected function execute($sql)
/**
* Returns the total number of rows affected by this query.
*
* @return mixed
* @return int
*/
public function affectedRows(): int
{
Expand All @@ -154,7 +173,7 @@ public function affectedRows(): int
*
* @return array
*/
public function error()
public function error(): array
{
return [
'code' => null,
Expand All @@ -169,7 +188,7 @@ public function error()
*
* @return integer
*/
public function insertID()
public function insertID(): int
{
return $this->connID->insert_id;
}
Expand All @@ -183,7 +202,7 @@ public function insertID()
*
* @return string
*/
protected function _listTables($constrainByPrefix = false): string
protected function _listTables(bool $constrainByPrefix = false): string
{
return '';
}
Expand Down
4 changes: 2 additions & 2 deletions _support/Database/MockResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ public function dataSeek($n = 0)
*
* Overridden by driver classes.
*
* @return array
* @return mixed
*/
protected function fetchAssoc(): array
protected function fetchAssoc()
{
}

Expand Down
7 changes: 7 additions & 0 deletions _support/Database/MockTestClass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Tests\Support\Database;

class MockTestClass
{
}
2 changes: 1 addition & 1 deletion _support/Events/MockEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @copyright 2014-2018 British Columbia Institute of Technology (https://bcit.ca/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 3.0.0
* @since Version 4.0.0
* @filesource
*/

Expand Down
2 changes: 1 addition & 1 deletion _support/Language/en/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @copyright 2014-2018 British Columbia Institute of Technology (https://bcit.ca/)
* @license https://opensource.org/licenses/MIT MIT License
* @link https://codeigniter.com
* @since Version 3.0.0
* @since Version 4.0.0
* @filesource
*
* @codeCoverageIgnore
Expand Down
4 changes: 3 additions & 1 deletion _support/Models/EntityModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class EntityModel extends Model

protected $useSoftDeletes = false;

protected $dateFormat = 'datetime';
protected $dateFormat = 'int';

protected $deletedField = 'deleted';

protected $allowedFields = [
'name',
Expand Down
2 changes: 1 addition & 1 deletion _support/Models/EventModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class EventModel extends Model

protected $useSoftDeletes = false;

protected $dateFormat = 'integer';
protected $dateFormat = 'datetime';

protected $allowedFields = [
'name',
Expand Down
6 changes: 5 additions & 1 deletion _support/Models/JobModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ class JobModel extends Model

protected $useSoftDeletes = false;

protected $dateFormat = 'integer';
protected $dateFormat = 'int';

protected $allowedFields = [
'name',
'description',
];

public $name = '';

public $description = '';
}
2 changes: 1 addition & 1 deletion _support/Models/SecondaryModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SecondaryModel extends Model

protected $useSoftDeletes = false;

protected $dateFormat = 'integer';
protected $dateFormat = 'int';

protected $allowedFields = [
'key',
Expand Down
2 changes: 2 additions & 0 deletions _support/Models/SimpleEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class SimpleEntity extends Entity
protected $id;
protected $name;
protected $description;
protected $deleted;
protected $created_at;
protected $updated_at;

protected $_options = [
'datamap' => [],
Expand Down
8 changes: 7 additions & 1 deletion _support/Models/UserModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@ class UserModel extends Model

protected $useSoftDeletes = true;

protected $dateFormat = 'integer';
protected $dateFormat = 'datetime';

public $name = '';

public $email = '';

public $country = '';
}
2 changes: 1 addition & 1 deletion _support/Models/ValidErrorsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ValidErrorsModel extends Model

protected $useSoftDeletes = false;

protected $dateFormat = 'integer';
protected $dateFormat = 'int';

protected $allowedFields = [
'name',
Expand Down
2 changes: 1 addition & 1 deletion _support/Models/ValidModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ValidModel extends Model

protected $useSoftDeletes = false;

protected $dateFormat = 'integer';
protected $dateFormat = 'int';

protected $allowedFields = [
'name',
Expand Down
17 changes: 17 additions & 0 deletions _support/View/MockTable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
namespace Tests\Support\View;

class MockTable extends \CodeIgniter\View\Table {

// Override inaccessible protected method
public function __call($method, $params)
{
if (is_callable([$this, '_' . $method]))
{
return call_user_func_array([$this, '_' . $method], $params);
}

throw new BadMethodCallException('Method ' . $method . ' was not found');
}

}
15 changes: 0 additions & 15 deletions app/Config/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,4 @@ class App extends BaseConfig
*/
public $CSPEnabled = false;

/*
|--------------------------------------------------------------------------
| Application Salt
|--------------------------------------------------------------------------
|
| The $salt can be used anywhere within the application that you need
| to provide secure data. It should be different for every application
| and can be of any length, though the more random the characters
| the better.
|
*/
public $salt = '';

//--------------------------------------------------------------------

}
Loading

0 comments on commit 4fc8c85

Please sign in to comment.