Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common InsertTest class tests undocumented use case #139

Open
djmattyg007 opened this issue Apr 16, 2017 · 7 comments
Open

Common InsertTest class tests undocumented use case #139

djmattyg007 opened this issue Apr 16, 2017 · 7 comments

Comments

@djmattyg007
Copy link
Contributor

The common InsertTest class tests an undocumented way of binding values to a query object. The testBindValues() method calls AbstractQuery::bindValues() with a non-associative array. This use case doesn't appear to be documented, and isn't used by any other code. Is this intentional? Does this test even belong in the InsertTest class?

@djmattyg007
Copy link
Contributor Author

Judging by #134, it looks like non-named placeholders aren't even supported now, so perhaps this test should just be refactored to use an associative array?

@harikt
Copy link
Member

harikt commented Apr 19, 2017

@djmattyg007 I am confused. Are you looking at

$this->assertInstanceOf('\Aura\SqlQuery\AbstractQuery', $this->query->bindValues(array('bar', 'bar value')));
? or can you link to the test case you are looking at .

Thank you.

@djmattyg007
Copy link
Contributor Author

Yes, that is what I'm looking at.

@harikt
Copy link
Member

harikt commented Apr 20, 2017

@djmattyg007 looking into that test case, it is only a test for the bindValues is returning an instance. So even if it is not associative it doesn't have any problem to me.

The interface doesn't even care to send an exception if they are wrong.

public function bindValues(array $bind_values);

So there is nothing wrong.

If you want to correct to make it associative it is not a problem also. Send a PR.

Thank you.

@djmattyg007
Copy link
Contributor Author

I think that test case and the one below it should be moved to a different class altogether. They're testing methods on the abstract query class.

@djmattyg007
Copy link
Contributor Author

It's probably best to wait for #142 to be resolved before trying to make changes to this.

@harikt
Copy link
Member

harikt commented Apr 20, 2017

I didn't noticed it earlier. Thank you for the mention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants