« first day (2713 days earlier)      last day (2460 days later) » 

21:00
also, FYI, it looks like you are looking at the master branch code - it does not have documentation yet (you could say, it is 2.0-dev .. there were few major architectural shifts)
Yeah. I am looking at master.
I haven't broken the rule of using the actual object yet so I'll give mocking a whirl.
Man though, these API mapper tests are always really long.
@Allenph there was a really good article from fowler about it .. 1 sec
Thanks.
21:16
\o
So basically @tereško the answer is "it's up to you."
unfortunately, that the default answer, when it comes to unit tests
btw, @Allenph, did you happen to come across some youtube videos, that are good for people, who are just starting to learn about writing unit tests
You know, I usually do YouTube videos when I'm learning something new. This time I was able to just feel my way through it with articles though.
I need to find something for junior coworkers .. and what I have not can be concisely describes as "fuck all"
It's really not that hard most of the time. I had a few hiccups but people in here helped a lot.
21:28
@tereško not trying to be mean, just letting you know since I think you said you wanted to be told when your English can be improved. You're using too many commas.
In fact Spys were just kind a natural thing. I only learned they were a specific thing after the fact.
@Tiffany yeah, that's a latvian problem
fair enough
I am basically applying latvian grammar rules, when it comes to commas in english
if you do find videos, I'd like to watch them
I wonder if I can get a standing desk
21:31
you don't want it
@tereško This was what really gave me my start. I disagree with some of the things he's doing in here and I do them slightly differently, but.
what you really need is a better chair
that's why I would get a big chair to go along with it, for the times that standing starts to hurt
I see it more as a fad
hell, we buy big chairs for classrooms
but most of the faculty don't even use them, lol
21:33
If you just actually read them.
@tereško there is a benefit to lower back pain by standing instead of sitting. Granted it's not completely healthy to stand the entire day either, but that's what mixing chair and standing is for
maybe I really should just tell them to put on their big-boy-pants and start banging at the tutorial
can they come to you if they have questions/problems?
@tereško If they don't want to read the tutorial they're just being lazy.
It only took like an hour to get 99% of what I needed.
Then I referred back to that thing for several days.
21:35
@Tiffany they can, but they won't
@tereško @Tiffany very much +1, and I think @Wes will concur.
Get a chair that actually supports you correctly in the position that you naturally assume (things that attempt to "encourage good posture" also suck) and just get up and walk around at reasonable intervals.
Slightly ironically, smoking helps with this :-P
my $0.02
@Tiffany banging the head at the wall until of them breaks seems to be a genetic flaw in this population
I should just set a reminder in Outlook for the morning and afternoon - "GO WALK"
21:38
or just take up smoking
yeah...no
@DaveRandom I say that same thing.
I like my lungs pink
I get up to vape every 30 to an hour.
and not in pain
21:39
@Tiffany Start vaping then.
more like "I like my lungs on the inside"
Needlessly addict yourself to nicotine. All the cool kids are doing it.
...no
All the cool kids and @DaveRandom.
@Tiffany an ex-colleague used to have a whiskey tumbler that he used for water, because it was small and would force him to get up more often to go get more
21:40
I tried smoking a couple of times while I was hanging out with my cousin, the first night... I was fine... the second night, my throat and esophagus felt like they were on fire. That was it for me.
@Allenph protip: this goal is easily achievable if you just start smoking lots of weed
/me drives, lata
I do have a water bottle that I have to refill, but I usually refill a gallon water jug and then refill my water bottle with that, then refill the gallon jug when it's empty. ... maybe I'll ditch the jug.
@DaveRandom Why does that help you get addicted to nicotine?
@Wes they are not subject to namespace fallback
@Tiffany, Earlier i asked a question in relation to workbench on the SQL chat room about 3 hours ago, but it hasnt been answered yet and not many seem to be online there, is it ok if I can ask it to you here, because you know the program?
21:46
sure
but I'll be leaving in ~10 minutes
@Tiffany My question was, is there a way i can make mysql workbench automatically differentiate relationships between tables, by having the relation lines show in different colours? For my current project, i have several tables, which in some way relate back to many of the other tables (not in a many to many relation), and this makes all relation lines overlap and messy.
That I'm not sure on. I've only used Workbench for some basic queries.
he's talking about "Model" screen I think
queries that I used to run on phpmyadmin, before I forced myself to switch to Workbench
as in ER Model Diagram
@SShah you should be able to move around the tables in the diagram to untangle it
21:52
@tereško yes the ER Diagram, its become so messy due to all lines over lapping to represent the relations, making it hard for me to assess whats going on from looking at it
that diagram is interactive ... so, interact :P
also, when you mouse-over a column, it should highlight the relation ... I think
I don't have workbench installed on the system I currently am at
@tereško I have tried, but because many of the relations are related to several other tables, so no matter how much i move it around, there is always going to be some overlap. I was hoping to print it, to better understand, as it has been 2 years, since I last worked using php and sql, so trying to normalise my project and creating an ER diagram has already been challenging enough :D
I have never really used those diagrams for anything practical
Essentially I have an idea for a project, and I am planning to build it out all the way. I am also using this as a way to re learn PHP and SQL because since I graduated, I have been mainly focusing with python and now I feel like I am forgetting all those core languages aswell. Simply put the idea I had, was quite complex for my tiny brain, so I thought I make use of the work bench ER diagram to help me better understand and plan it.
@tereško Do you use traits when you need a method to produce a similar mock over and over?
It's rather annoying that I can't create a class that uses the PHPUnit createMock method to generate itself.
22:02
no, I just make a private method in the unti class
Also I needed to build the Mysql workbench model, so that it could allow me to export it as an SQL script and I could use that to easily import it on the phpmyadmin interface on my wampstack.
Meh. I need the same mock over multiple tests.
@SShah you can export it without needing to do that
you just need to select, that you what "only schema" and not the data
@tereško Thanks, where might i find the "only schema" option, i cant see it on the export section
the should be checkbox "skip data"
or something like that
22:09
@teresko By "Skip data" are you refereing to test data for the tables?, because currently I have only used mysql workbench to create the individual tables and column names, and then have defined the column relationships from there. I havent put any test/ dummy data for it to insert upon creation. I was thinking of doing that on phpmyadmin
do whatever you want
/me off to read a book
@teresko Again sorry, I am just doing things based on how I remember learning them at uni.
Thank you very much for all your help, and sorry to everyone for all the trouble.
Since you guys are talking about unit testing, would you mind answering a question that I've had for a while about unit testing with a database?
22:36
Ha:
> PHP Fatal error: Scalar type declaration 'iterable' must be unqualified in [. . .]
@WilliamBingHua Sure.
@LeviMorrison Did you try \iterable?
@bwoebi Yes, but the "ha" was about the error being goofy because it's not a scalar type.
I don't understand how PHPUnit can be based around testing OO but not be all that OO.
Maybe I'm just doing something wrong.
ReflectionParameter names and documentation variable names not matching up – #76131
22:47
> PHPUnit is a programmer-oriented testing framework for PHP. It is an instance of the xUnit architecture for unit testing frameworks.
Not sure where you are getting this object-oriented stuff. Clearly it's programmer-oriented.
Rofl.
Thx @Allenph

I think I have a basic grasp of concepts like Dependency Injection, Mocks, Stubs, etc in the context of unit testing. However, I can't figure out how to start unit testing my webapp backend (I use CodeIgniter) code because of how frequently it interacts with the database.

I don't think I can use Dependency Injection to create a mock database object since the db object is an instance variable of the CodeIgniter framework? Even if I could, I don't know how to create an adequate mock to return everything that's required (I can give a more detailed example if this is confusing)
@WilliamBingHua I'm not the most experienced either but I see a few potential reasons some of those things could be happening.
If you're not using the ORM, what do your "models" look like? Are they active record?

What people in here have taught me is separate the persistence logic and the domain object logic by making two separate objects. A domain object which is an object representing something in your application like a `user` or something, and a datamapper which retrieves and persists user objects from the database.
As for your configuration, I'm guessing that you're setting some kind of global with your configuration, then using those globals directly in your objects. A way to get around this would be to dependency inject the configuration variables you need into the objects that need them rather than using globals.
I was under the impression that you should use live data as well, but this turned out to be wrong. What you should do is create fixtures for your tests which express cases you're looking to test for.
Being tightly coupled to CodeIgniter is also probably a problem.
23:08
I think a lot of what you're saying makes sense. Luckily enough I do have a "Domain" object (but no persistence logic? and a layer to map from the database but I'm still having some difficulty wrapping my head around a solution. My models use raw MySQL and call CodeIgniter's database methods, which returns an object (or array of objects) where the properties are the columns of the table I queried. I guess this could be considered a small ORM?

I think an example might be easier to illustrate some pain points

« first day (2713 days earlier)      last day (2460 days later) »