#1049 new
eugenioclrc

enum support patch for testing

Reported by eugenioclrc | August 25th, 2010 @ 02:52 PM | in Future

Hi, as you know mysql its a very popular database.

Its well know that cakePHP doesnt support enum type, so when a mysql user test the application will find out some problems when the test table its created.

To solve this problem just add the follows lines in your Fixture class


class ModelnameFixture extends CakeTestFixture {

{mkd-extraction-2a7fedba0c6371068af68966cad63186}

}

I have an attach that modified the method create in the CakeTestFixture class, it will be great i you could added to cakephp.

Cheers!

Comments and changes to this ticket

  • Mark Story

    Mark Story August 26th, 2010 @ 07:20 PM

    • → Milestone set to Future
    • → Tag changed from enum, fixtures, patch, schema, support, testing to enhancement, enum, fixtures, patch, schema, support, testing

    Why are you adding enum support to the fixture class? Shouldn't it go into the dbo class?

  • eugenioclrc

    eugenioclrc August 26th, 2010 @ 07:51 PM

    Yeah Mark, you are totally right, is there some place else the api documentation where i can read more about the core of php?
    How i can get more involve in the cakephp development?

  • Mark Story

    Mark Story August 26th, 2010 @ 10:33 PM

    Most of the internals don't have a ton of documentation outside of the doc blocks. As for contributing, opening tickets and providing patches is a great way to get involved :)

  • michaelc

    michaelc August 27th, 2010 @ 11:54 AM

    Somebody who has done the work to read CakePHP should set up an introduction to contributors... though they'd rather spend the time submitting patches to the core, I guess ^_^;;;;. I'm as guilty as the rest, I guess. I got started with a horrible app that broke convention all over the place and barely ran, badly. I had to understand the internals of CakePHP very well just in order to make it work at all. I then started at the dispatcher & just started reading, skipping over execution paths (like the guts of the router) which I didn't need to know and weren't trivial to understand. Now the company is thinking about creating a fork of CakePHP for performance reasons (when you deploy a single app across a pile of servers for a pile of customers, even small performance improvements become major - if you can store 50 on a $1000 server, you fix it to make it able to run 51, you saved $20 if you have 1 server, $200 if you have 10, and $2000 if you have 100 servers... for only a 1% performance boost you save $1000 for 100 servers.). Needless to say, I've read a lot of CakePHP :P. Were I you, I'd start reading from the entry point of whatever I was interested in. Model::save() is a good read, helped me understand why sometimes it saved and sometimes it updated back when. Model::find() is a good entry point if you like the Dbo stuff. Dispatcher is good for Controllers and overall process. Controller::render() helps to understand the view.

  • eugenioclrc

    eugenioclrc August 27th, 2010 @ 09:54 PM

    its this better?

    --- cake/libs/model/datasources/dbo_source.php 2010-08-25 14:16:19.381096012 -0300 +++ cake/libs/model/datasources/dbo_source.php 2010-08-27 23:22:10.557032077 -0300 @@ -2722,6 +2722,10 @@

            return null;
        }
    
    • if (!isset($this->columns[$type]) && (substr($type,0,4)=='enum')){
      
    •     $type = 'string';
      
    • }
      
    • if (!isset($this->columns[$type])) {
          trigger_error(sprintf(__('Column type %s does not exist', true), $type), E_USER_WARNING);
          return null;
      

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Source available from github

Repository is at http://github.com/cakephp/cakephp

Creating a bug report

When creating a bug report, please include as much relevant information as possible. Please include code to reproduce the issue. Or even better, make a unit test. Either change an existing test or add a new test to show that the expected behavior is not occuring.

People watching this ticket

Attachments